Documentation
¶
Index ¶
- func NamedValueToParams(args []driver.NamedValue) []environment.Param
- type Conn
- func (c *Conn) Begin() (driver.Tx, error)
- func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (c *Conn) Close() error
- func (c *Conn) Conn() *database.Connection
- func (c *Conn) DB() *database.Database
- func (c *Conn) ExecContext(ctx context.Context, q string, args []driver.NamedValue) (driver.Result, error)
- func (c *Conn) Prepare(q string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(ctx context.Context, q string) (driver.Stmt, error)
- func (c *Conn) QueryContext(ctx context.Context, q string, args []driver.NamedValue) (driver.Rows, error)
- func (c *Conn) ResetSession(ctx context.Context) error
- type Connector
- type Driver
- type ExecResult
- type Rows
- type Stmt
- func (s Stmt) Close() error
- func (s *Stmt) Exec(args []driver.Value) (driver.Result, error)
- func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (s *Stmt) NumInput() int
- func (s Stmt) Query(args []driver.Value) (driver.Rows, error)
- func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamedValueToParams ¶
func NamedValueToParams(args []driver.NamedValue) []environment.Param
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection to the Chai database. It implements the database/sql/driver.Conn interface.
func (*Conn) BeginTx ¶
BeginTx starts and returns a new transaction. It uses the ReadOnly option to determine whether to start a read-only or read/write transaction. If the Isolation option is non zero, an error is returned.
func (*Conn) Conn ¶
func (c *Conn) Conn() *database.Connection
func (*Conn) ExecContext ¶ added in v0.18.0
func (*Conn) PrepareContext ¶
PrepareContext returns a prepared statement, bound to this connection.
func (*Conn) QueryContext ¶ added in v0.18.0
type Driver ¶
type Driver struct{}
Driver is a driver.Driver that can open a new connection to a Chai database. It is the driver used to register Chai against the database/sql package.
type ExecResult ¶
type ExecResult struct{}
func (ExecResult) LastInsertId ¶
func (r ExecResult) LastInsertId() (int64, error)
LastInsertId is not supported and returns an error.
func (ExecResult) RowsAffected ¶
func (r ExecResult) RowsAffected() (int64, error)
RowsAffected is not supported and returns an error.
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
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.
func (*Stmt) QueryContext ¶
QueryContext executes a query that may return rows, such as a SELECT.