Documentation
¶
Overview ¶
Package stdlib is a compatibility layer/driver intended to be used with the standard library's database/sql package
Index ¶
- Variables
- 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) CheckNamedValue(val *driver.NamedValue) error
- func (c *Conn) Client() ksql.Client
- func (c *Conn) Close() error
- func (c *Conn) Connect(context.Context) (driver.Conn, error)
- func (c *Conn) Driver() driver.Driver
- func (c *Conn) ExecContext(ctx context.Context, stmt string, args []driver.NamedValue) (driver.Result, error)
- func (c *Conn) IsValid() bool
- func (c *Conn) Ping(ctx context.Context) error
- func (c *Conn) Prepare(query string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- func (c *Conn) ResetSession(ctx context.Context) error
- type Connector
- type Driver
- type PreparedStatement
- func (p PreparedStatement) Close() error
- func (p PreparedStatement) Exec(args []driver.Value) (driver.Result, error)
- func (p PreparedStatement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (p PreparedStatement) NumInput() int
- func (p PreparedStatement) Query(args []driver.Value) (driver.Rows, error)
- func (p PreparedStatement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTransactionsNotSupported is a placeholder returned by sql driver transaction related methods, given that no such functionality exists currently in ksqlDB ErrTransactionsNotSupported = errors.New("Transactions are not supported by the kafka-go driver, please use Query or Exec instead") // ErrInvalidQueryStrategy is returned when the provided query strategy is not supported or doesn't exist ErrInvalidQueryStrategy = errors.New("unrecognised query strategy") )
var ( // ErrMissingSemicolon is returned when the sql statement is missing a trailing semi-colon ErrMissingSemicolon = errors.New("statement is missing a trailing semi-colon") )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn provides the driver.Conn interface for interacting with the ksqlDB client
func (*Conn) CheckNamedValue ¶
func (c *Conn) CheckNamedValue(val *driver.NamedValue) error
CheckNamedValue is used here to filter out config options from the final args
func (*Conn) ExecContext ¶
func (c *Conn) ExecContext(ctx context.Context, stmt string, args []driver.NamedValue) (driver.Result, error)
ExecContext executes any arbitrary ksql statements, except queries
func (*Conn) Prepare ¶
Prepare a SQL query. Note that there are no optimizations here and this method is only provided for compatibility reasons.
func (*Conn) PrepareContext ¶
PrepareContext is a placeholder, prepared statements are not supported in ksqlDB
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector implements the database/sql/driver package's Connector interface
func NewConnector ¶
NewConnector allows a specific client to be passed to database/sql compatible connectors
type Driver ¶
type Driver struct{}
Driver is a database/sql compatible driver
type PreparedStatement ¶
PreparedStatement imitates a pre loaded sql statement
func (PreparedStatement) Close ¶
func (p PreparedStatement) Close() error
Close closes the ksqlDB connection
func (PreparedStatement) Exec ¶
Exec is equivalent to running the given sql statement via the Execer interface
func (PreparedStatement) ExecContext ¶
func (p PreparedStatement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
ExecContext is equivalent to running the given sql statement via the ExecerContext interface
func (PreparedStatement) NumInput ¶
func (p PreparedStatement) NumInput() int
NumInput always returns -1 to allow any number of arguments
func (PreparedStatement) Query ¶
Query is equivalent to running the given sql statement via the Queryer interface
func (PreparedStatement) QueryContext ¶
func (p PreparedStatement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
QueryContext is equivalent to running the given sql statement via the QueryerContext interface