postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package postgres parses PostgreSQL connection imports and owns their cached runtime pools.

Index

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 New

func New() *Adapter

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 (*Discoverer) ListSchemas

func (*Discoverer) ListTables

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) Close

func (o *Opener) Close(ctx context.Context) error

Close rejects new opens and waits for tracked runtime resources within ctx.

func (*Opener) Invalidate

func (o *Opener) Invalidate(id connection.ID)

Invalidate detaches an ID's current generation and closes its pool asynchronously.

func (*Opener) Open

func (o *Opener) Open(ctx context.Context, id connection.ID) (*Client, error)

Open returns a cached runtime or authenticates one shared opening attempt.

func (*Opener) OpenQuery

func (o *Opener) OpenQuery(ctx context.Context, id connection.ID) (*Client, error)

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)

type QueryOptions

type QueryOptions struct {
	Timeout           time.Duration
	ResponseByteLimit int
	TruncationEnabled bool
	RowLimit          int
}

Jump to

Keyboard shortcuts

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