Documentation
¶
Index ¶
- Constants
- Variables
- type Driver
- func (d *Driver) Begin(ctx context.Context, isolation config.TxIsolationLevel) (driver.Tx, error)
- func (*Driver) ClassifyError(err error) driver.ErrorFacts
- func (d *Driver) Insert(ctx context.Context, req *driver.InsertRequest) (*stats.Query, error)
- func (d *Driver) PoolMaxConns() int
- func (*Driver) PoolStats() driver.PoolSnapshot
- func (d *Driver) RunQuery(ctx context.Context, sql string, args map[string]any) (*driver.QueryResult, error)
- func (d *Driver) Teardown(_ context.Context) error
- type Executor
- type PicoDialect
- type PoolX
Constants ¶
View Source
const (
LoggerName = "picodata-driver"
)
Variables ¶
View Source
var ( ErrNativeUnsupported = errors.New("NATIVE insert is not supported in Picodata yet") ErrTransactionsUnsupported = errors.New("transactions are not supported in Picodata yet") )
View Source
var ErrUnsupportedType = errors.New("unsupported value type")
ErrUnsupportedType is returned when a query value has an unrecognized type.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements the driver.Driver interface for Picodata DB.
func (*Driver) ClassifyError ¶
func (*Driver) ClassifyError(err error) driver.ErrorFacts
func (*Driver) Insert ¶
Insert runs a typed driver.InsertRequest through the picodata driver. Each worker prepares a gen.Cursor partition, adapts it to a source.RowSource, and drains it through runInsertChunk.
func (*Driver) PoolMaxConns ¶ added in v6.3.0
func (*Driver) PoolStats ¶ added in v6.4.0
func (*Driver) PoolStats() driver.PoolSnapshot
type Executor ¶
type Executor interface {
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
ExecContext(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryContext(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
Ping(ctx context.Context) error
Close()
Config() *pgxpool.Config
}
type PicoDialect ¶
type PicoDialect struct{}
PicoDialect implements sqlqueries.Dialect for Picodata via pgx.
func (PicoDialect) Deduplicate ¶
func (PicoDialect) Deduplicate() bool
func (PicoDialect) Placeholder ¶
func (PicoDialect) Placeholder(index int) string
func (PicoDialect) StatementDeadline ¶
func (PicoDialect) StatementDeadline(timeout time.Duration) time.Duration
StatementDeadline returns timeout unchanged; there is no server-side hint to outlast.
func (PicoDialect) StatementTimeoutHint ¶
StatementTimeoutHint returns sql unchanged; picodata honors context cancellation for its per-statement deadline.
type PoolX ¶
PoolX wraps *picodata.Pool and adds ExecContext/QueryContext to satisfy Executor.
func (*PoolX) ExecContext ¶
Click to show internal directories.
Click to hide internal directories.