Documentation
¶
Overview ¶
Package postgres parses PostgreSQL connection imports and owns their cached runtime pools.
Index ¶
- Constants
- Variables
- type Adapter
- type Client
- type DefinitionPreparer
- type Discoverer
- func (d *Discoverer) Kind() connection.Kind
- func (d *Discoverer) ListColumns(ctx context.Context, request execution.ColumnDiscoveryRequest) (execution.ColumnDiscoveryPage, error)
- func (d *Discoverer) ListSchemas(ctx context.Context, request execution.SchemaDiscoveryRequest) (execution.SchemaDiscoveryPage, error)
- func (d *Discoverer) ListTables(ctx context.Context, request execution.TableDiscoveryRequest) (execution.TableDiscoveryPage, error)
- type Opener
- type QueryExecutor
- type QueryOptions
Constants ¶
View Source
const (
Kind connection.Kind = "postgres"
)
Variables ¶
View Source
var ( ErrUnsupportedKind = errors.New("postgres: unsupported database kind") ErrOpenTimeout = errors.New("postgres: open timeout") ErrRuntimeClosed = errors.New("postgres: runtime closed") ErrShutdownTimeout = errors.New("postgres: shutdown timeout") )
View Source
var ErrInvalidConnectionString = errors.New("postgres: invalid connection string")
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}
func (*Adapter) Kind ¶
func (*Adapter) Kind() connection.Kind
func (*Adapter) ParseConnectionString ¶
func (*Adapter) ParseConnectionString(input []byte) (connection.ParsedConnection, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a cached Postgres runtime handle reserved for internal capabilities.
type DefinitionPreparer ¶
type DefinitionPreparer interface {
Prepare(context.Context, connection.ID) (connection.ResolvedDefinition, error)
}
DefinitionPreparer resolves the current saved definition and its secrets.
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(opener clientOpener) (*Discoverer, error)
func (*Discoverer) Kind ¶
func (d *Discoverer) Kind() connection.Kind
func (*Discoverer) ListColumns ¶
func (d *Discoverer) ListColumns( ctx context.Context, request execution.ColumnDiscoveryRequest, ) (execution.ColumnDiscoveryPage, error)
func (*Discoverer) ListSchemas ¶
func (d *Discoverer) ListSchemas( ctx context.Context, request execution.SchemaDiscoveryRequest, ) (execution.SchemaDiscoveryPage, error)
func (*Discoverer) ListTables ¶
func (d *Discoverer) ListTables( ctx context.Context, request execution.TableDiscoveryRequest, ) (execution.TableDiscoveryPage, error)
type Opener ¶
type Opener struct {
// contains filtered or unexported fields
}
Opener lazily authenticates and caches one Postgres runtime per database ID.
func NewOpener ¶
func NewOpener(preparer DefinitionPreparer) (*Opener, error)
NewOpener constructs an opener without contacting PostgreSQL.
func (*Opener) Invalidate ¶
func (o *Opener) Invalidate(id connection.ID)
Invalidate detaches an ID's current generation and closes its pool asynchronously.
type QueryExecutor ¶
type QueryExecutor struct {
// contains filtered or unexported fields
}
func NewQueryExecutor ¶
func NewQueryExecutor( opener queryClientOpener, options QueryOptions, ) (*QueryExecutor, error)
func (*QueryExecutor) Kind ¶
func (e *QueryExecutor) Kind() connection.Kind
func (*QueryExecutor) Query ¶
func (e *QueryExecutor) Query( requestContext context.Context, request execution.RelationalQueryExecutionRequest, ) (result execution.RelationalQueryResult, returnErr error)
Click to show internal directories.
Click to hide internal directories.