Documentation
¶
Overview ¶
Package postgresql is the PostgreSQL direct engine (#82): Baleia runs SQL on a PostgreSQL connection itself, without Trino. A session is one dedicated pool connection; results stream as Arrow, mapped from the pgx field descriptions. Every dial goes through connections.Dialer (docs/adr/0011).
Index ¶
- Constants
- func Spec(dl queryengine.Dialect) queryengine.KindSpec
- type Engine
- func (e *Engine) Cancel(ctx context.Context, h queryengine.QueryHandle) error
- func (e *Engine) Capabilities() queryengine.Capabilities
- func (e *Engine) Class() queryengine.Class
- func (e *Engine) Close() error
- func (e *Engine) Dialect() queryengine.Dialect
- func (e *Engine) ID() string
- func (e *Engine) Introspector() queryengine.Introspector
- func (e *Engine) Kind() string
- func (e *Engine) OpenSession(ctx context.Context, spec queryengine.SessionSpec) (queryengine.Session, error)
- func (e *Engine) Ping(ctx context.Context) error
- func (e *Engine) Version(ctx context.Context) (string, error)
Constants ¶
const Kind = "postgresql"
Kind is the registered engine kind.
Variables ¶
This section is empty.
Functions ¶
func Spec ¶
func Spec(dl queryengine.Dialect) queryengine.KindSpec
Spec is the kind's entry for a queryengine.Registry (#364).
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a PostgreSQL server reached directly.
func (*Engine) Cancel ¶
func (e *Engine) Cancel(ctx context.Context, h queryengine.QueryHandle) error
Cancel cancels a running statement from any process with pg_cancel_backend, using the handle's backend pid. A statement that is gone is not an error.
pg_cancel_backend stops whatever the backend runs at that moment, and the handle is reported before the statement reaches it (#505). So it is sent only while the backend runs the statement tagged in the handle, retried until it does: a cancel never hits another statement on a pooled connection, and one that arrives early is not lost. A handle without a tag (an older worker) cancels at once.
func (*Engine) Capabilities ¶
func (e *Engine) Capabilities() queryengine.Capabilities
Capabilities of PostgreSQL in v1.
func (*Engine) Class ¶
func (e *Engine) Class() queryengine.Class
func (*Engine) Dialect ¶
func (e *Engine) Dialect() queryengine.Dialect
func (*Engine) Introspector ¶
func (e *Engine) Introspector() queryengine.Introspector
func (*Engine) OpenSession ¶
func (e *Engine) OpenSession(ctx context.Context, spec queryengine.SessionSpec) (queryengine.Session, error)