ksqlite3

package module
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	_ context.Context,
	connectionString string,
	config ksql.Config,
) (ksql.DB, error)

New instantiates a new KSQL client using the "sqlite3" driver

func NewFromSQLDB

func NewFromSQLDB(db *sql.DB) (ksql.DB, error)

NewFromSQLDB builds a ksql.DB from a *sql.DB instance

Types

type SQLAdapter

type SQLAdapter struct {
	*sql.DB
}

SQLAdapter adapts the sql.DB type to be compatible with the `DBAdapter` interface

func NewSQLAdapter

func NewSQLAdapter(db *sql.DB) SQLAdapter

NewSQLAdapter returns a new instance of SQLAdapter with the provided database instance.

func (SQLAdapter) BeginTx

func (s SQLAdapter) BeginTx(ctx context.Context) (ksql.Tx, error)

BeginTx implements the Tx interface

func (SQLAdapter) Close

func (s SQLAdapter) Close() error

Close implements the io.Closer interface

func (SQLAdapter) ExecContext

func (s SQLAdapter) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)

ExecContext implements the DBAdapter interface

func (SQLAdapter) QueryContext

func (s SQLAdapter) QueryContext(ctx context.Context, query string, args ...interface{}) (ksql.Rows, error)

QueryContext implements the DBAdapter interface

type SQLRows added in v1.4.10

type SQLRows struct {
	*sql.Rows
}

SQLRows implements the ksql.Rows interface and is used to help the SQLAdapter to implement the ksql.DBAdapter interface.

func (SQLRows) Scan added in v1.4.10

func (p SQLRows) Scan(args ...interface{}) error

Scan implements the ksql.Rows interface

type SQLTx

type SQLTx struct {
	*sql.Tx
}

SQLTx is used to implement the DBAdapter interface and implements the Tx interface

func (SQLTx) Commit

func (s SQLTx) Commit(ctx context.Context) error

Commit implements the Tx interface

func (SQLTx) ExecContext

func (s SQLTx) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)

ExecContext implements the Tx interface

func (SQLTx) QueryContext

func (s SQLTx) QueryContext(ctx context.Context, query string, args ...interface{}) (ksql.Rows, error)

QueryContext implements the Tx interface

func (SQLTx) Rollback

func (s SQLTx) Rollback(ctx context.Context) error

Rollback implements the Tx interface

Jump to

Keyboard shortcuts

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