Documentation ¶
Overview ¶
package driver implements a DB driver that can be used by plugins to make SQL queries using RPC. This helps to avoid opening new connections for every plugin, and lets everyone use the central connection pool in the server. The tests for this package are at app/plugin_api_tests/test_db_driver/main.go.
Index ¶
- type Conn
- func (c *Conn) Begin() (tx driver.Tx, err error)
- func (c *Conn) BeginTx(_ context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (c *Conn) Close() error
- func (c *Conn) ExecContext(_ context.Context, q string, args []driver.NamedValue) (driver.Result, error)
- func (c *Conn) Ping(_ context.Context) error
- func (c *Conn) Prepare(q string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(_ context.Context, q string) (driver.Stmt, error)
- func (c *Conn) QueryContext(_ context.Context, q string, args []driver.NamedValue) (driver.Rows, error)
- type Connector
- type Driver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a DB driver conn implementation which executes queries using the Plugin DB API.
func (*Conn) ExecContext ¶
func (*Conn) PrepareContext ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector is the DB connector which is used to communicate with the DB API.
func NewConnector ¶
NewConnector returns a DB connector that can be used to return a sql.DB object. It takes a plugin.Driver implementation and a boolean flag to indicate whether to connect to a master or replica DB instance.