Documentation ¶
Index ¶
- Constants
- func RegisterCustomSessionGenerator(identifier string, generator CustomSessionGenerator) error
- type Config
- type Conn
- func (conn *Conn) Begin() (driver.Tx, error)deprecated
- func (conn *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (conn *Conn) Close() error
- func (conn *Conn) Prepare(query string) (driver.Stmt, error)
- func (conn *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- type CustomSessionGenerator
- type Driver
- type Result
- type Rows
- type Stmt
- func (stmt *Stmt) Close() error
- func (stmt *Stmt) Exec(args []driver.Value) (driver.Result, error)
- func (stmt *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (stmt *Stmt) NumInput() int
- func (stmt *Stmt) Query(args []driver.Value) (driver.Rows, error)deprecated
- func (stmt *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
Constants ¶
const ( ExecutionStatusRunning = "RUNNING" ExecutionStatusSucceeded = "SUCCEEDED" )
Statuses
Variables ¶
This section is empty.
Functions ¶
func RegisterCustomSessionGenerator ¶
func RegisterCustomSessionGenerator(identifier string, generator CustomSessionGenerator) error
RegisterCustomSessionGenerator registers session generator
Types ¶
type Config ¶
Config contains all configuration from passed dsn
func ConfigFromDSN ¶
ConfigFromDSN returns new config based on given dsn
type Conn ¶
type Conn struct {
Config Config
}
Conn is single driver connection
func (*Conn) BeginTx ¶
BeginTx starts and returns a new transaction. If the context is canceled by the user the sql package will call Tx.Rollback before discarding and closing the connection.
This must check opts.Isolation to determine if there is a set isolation level. If the driver does not support a non-default level and one is set or if there is a non-default isolation level that is not supported, an error must be returned.
This must also check opts.ReadOnly to determine if the read-only value is true to either set the read-only transaction property if supported or return an error if it is not supported.
func (*Conn) Close ¶
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.
type CustomSessionGenerator ¶
CustomSessionGenerator is custom session generator function for AWS
type Result ¶
type Result struct{}
Result is response of given execution
func (*Result) LastInsertId ¶
LastInsertId returns the integer generated by the database in response to a command. Typically this will be from an "auto increment" column when inserting a new row. Not all databases support this feature, and the syntax of such statements varies.
func (*Result) RowsAffected ¶
RowsAffected returns the number of rows affected by an update, insert, or delete. Not every database or database driver may support this.
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows is an iterator over an executed query's results.
func (*Rows) Columns ¶
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) Next ¶
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
}
Stmt is a prepared statement. It is bound to a Conn and not used by multiple goroutines concurrently.
func (*Stmt) ExecContext ¶
ExecContext executes a query that doesn't return rows, such as an INSERT or UPDATE.
ExecContext must honor the context timeout and return when it is canceled.
func (*Stmt) QueryContext ¶
QueryContext executes a query that may return rows, such as a SELECT.
QueryContext must honor the context timeout and return when it is canceled.