Documentation
¶
Index ¶
- func New(ctx context.Context, connectionString string, config ksql.Config) (db ksql.DB, err error)
- func NewFromPgxPool(pool *pgxpool.Pool) (db ksql.DB, err error)
- type PGXAdapter
- func (p PGXAdapter) BeginTx(ctx context.Context) (ksql.Tx, error)
- func (p PGXAdapter) Close() error
- func (p PGXAdapter) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)
- func (p PGXAdapter) QueryContext(ctx context.Context, query string, args ...interface{}) (ksql.Rows, error)
- type PGXResult
- type PGXRows
- type PGXTx
- func (p PGXTx) Commit(ctx context.Context) error
- func (p PGXTx) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)
- func (p PGXTx) QueryContext(ctx context.Context, query string, args ...interface{}) (ksql.Rows, error)
- func (p PGXTx) Rollback(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PGXAdapter ¶
type PGXAdapter struct {
// contains filtered or unexported fields
}
PGXAdapter adapts the sql.DB type to be compatible with the `DBAdapter` interface
func NewPGXAdapter ¶
func NewPGXAdapter(db *pgxpool.Pool) PGXAdapter
NewPGXAdapter instantiates a new pgx adapter
func (PGXAdapter) Close ¶
func (p PGXAdapter) Close() error
Close implements the io.Closer interface
func (PGXAdapter) ExecContext ¶
func (p PGXAdapter) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)
ExecContext implements the DBAdapter interface
func (PGXAdapter) QueryContext ¶
func (p PGXAdapter) QueryContext(ctx context.Context, query string, args ...interface{}) (ksql.Rows, error)
QueryContext implements the DBAdapter interface
type PGXResult ¶
type PGXResult struct {
// contains filtered or unexported fields
}
PGXResult is used to implement the DBAdapter interface and implements the Result interface
func (PGXResult) LastInsertId ¶
LastInsertId implements the Result interface
func (PGXResult) RowsAffected ¶
RowsAffected implements the Result interface
type PGXRows ¶
type PGXRows struct {
pgx.Rows
}
PGXRows implements the ksql.Rows interface and is used to help the PGXAdapter to implement the ksql.DBAdapter interface.
type PGXTx ¶
type PGXTx struct {
// contains filtered or unexported fields
}
PGXTx is used to implement the DBAdapter interface and implements the Tx interface
func (PGXTx) ExecContext ¶
func (p PGXTx) ExecContext(ctx context.Context, query string, args ...interface{}) (ksql.Result, error)
ExecContext implements the Tx interface