driver

package
v0.0.0-...-4eea697 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AQLConn

type AQLConn struct {
	// contains filtered or unexported fields
}

func (*AQLConn) Begin deprecated

func (conn *AQLConn) Begin() (driver.Tx, error)

Begin starts and returns a new transaction.

Deprecated: Drivers should implement ConnBeginTx instead (or additionally).

func (*AQLConn) Close

func (conn *AQLConn) Close() error

Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.

Because the sql package maintains a free pool of connections and only calls Close when there's a surplus of idle connections, it shouldn't be necessary for drivers to do their own connection caching.

Drivers must ensure all network calls made by Close do not block indefinitely (e.g. apply a timeout).

func (*AQLConn) Prepare

func (conn *AQLConn) Prepare(query string) (driver.Stmt, error)

Prepare returns a prepared statement, bound to this connection.

func (*AQLConn) PrepareContext

func (conn *AQLConn) PrepareContext(_ context.Context, query string) (driver.Stmt, error)

func (*AQLConn) Rollback

func (conn *AQLConn) Rollback() error

implements driver.Tx interface Rollback - not implemented ...

type AQLDriver

type AQLDriver struct{}

func (*AQLDriver) Open

func (svc *AQLDriver) Open(name string) (driver.Conn, error)

type AQLRowser

type AQLRowser interface {
	driver.Rows
	NamedColumns() []Column
}

type Column

type Column struct {
	Name string
	Path string
}

type Row

type Row struct {
	// contains filtered or unexported fields
}

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

func (*Rows) Close

func (rs *Rows) Close() error

Close closes the rows iterator.

func (*Rows) Columns

func (rs *Rows) Columns() []string

Columns returns the names of the columns. The number of columns of the result is inferred from the length of the slice. If a particular column name isn't known, an empty string should be returned for that entry.

func (*Rows) NamedColumns

func (rs *Rows) NamedColumns() []Column

func (*Rows) Next

func (rs *Rows) Next(dest []driver.Value) error

Next is called to populate the next row of data into the provided slice. The provided slice will be the same size as the Columns() are wide.

Next should return io.EOF when there are no more rows.

The dest should not be written to outside of Next. Care should be taken when closing Rows not to modify a buffer held in dest.

type Stmt

type Stmt struct {
	// contains filtered or unexported fields
}

func (*Stmt) Close

func (stmt *Stmt) Close() error

Close closes the statement. As of Go 1.1, a Stmt will not be closed if it's in use by any queries.

Drivers must ensure all network calls made by Close do not block indefinitely (e.g. apply a timeout).

func (*Stmt) Exec deprecated

func (stmt *Stmt) Exec(args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return rows, such as an INSERT or UPDATE.

Deprecated: Drivers should implement StmtExecContext instead (or additionally).

func (*Stmt) NumInput

func (stmt *Stmt) NumInput() int

NumInput returns the number of placeholder parameters.

If NumInput returns >= 0, the sql package will sanity check argument counts from callers and return errors to the caller before the statement's Exec or Query methods are called.

NumInput may also return -1, if the driver doesn't know its number of placeholders. In that case, the sql package will not sanity check Exec or Query argument counts.

func (*Stmt) Query deprecated

func (stmt *Stmt) Query(args []driver.Value) (driver.Rows, error)

Query executes a query that may return rows, such as a SELECT.

Deprecated: Drivers should implement StmtQueryContext instead (or additionally).

func (*Stmt) QueryContext

func (stmt *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

QueryContext executes a query that may return rows, such as a SELECT.

QueryContext must honor the context timeout and return when it is canceled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL