Documentation
¶
Index ¶
- type Config
- type Connector
- func (c *Connector) Close() error
- func (c *Connector) Execute(ctx context.Context, queryData json.RawMessage, ...) (*result.ExecutionResult, error)
- func (c *Connector) ExecuteStatement(ctx context.Context, stmt string, args []any) (sqlconnector.Result, error)
- func (c *Connector) GetCapabilities() sqlconnector.Capabilities
- func (c *Connector) IntrospectSchema(ctx context.Context) (*sqlconnector.Schema, error)
- func (c *Connector) SQLPoolStats() stdsql.DBStats
- func (c *Connector) TestConnection(ctx context.Context) error
- type Credentials
- type TableMetadataObserver
- func (o TableMetadataObserver) AssessMetadata(raw json.RawMessage) (model.ProofVerdict, []model.ProofDiagnostic, error)
- func (o TableMetadataObserver) Description() string
- func (o TableMetadataObserver) MatchesResource(config, operation json.RawMessage, source bool) bool
- func (o TableMetadataObserver) Plan() (proofevidence.MetadataPlan, error)
- func (o TableMetadataObserver) ReadMetadata(ctx context.Context, transport proofevidence.MetadataIO, credential []byte, ...) (json.RawMessage, int64, proofevidence.Outcome)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DialFunc is supplied only by trusted runtime wiring, never by a source payload.
Authorize func(context.Context) error `json:"-"`
MaxConns int `json:"-"`
DialFunc pgconn.DialFunc `json:"-"`
Host string `json:"host" validate:"required,hostname|ip"`
Port int `json:"port" validate:"required,min=1,max=65535"`
Database string `json:"database" validate:"required"`
SSLMode string `json:"ssl_mode,omitempty"`
User string `json:"user" validate:"required"`
Password string `json:"password" validate:"required"`
ConnectTimeout int `json:"connect_timeout,omitempty"`
AllowPrivateHosts bool `json:"allow_private_hosts,omitempty"`
}
Config holds configuration for PostgreSQL connections.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector connects to PostgreSQL databases via pgx.
func (*Connector) Execute ¶
func (c *Connector) Execute( ctx context.Context, queryData json.RawMessage, params map[string]types.TypedParam, limits ...types.ExecutionLimits, ) (*result.ExecutionResult, error)
Execute runs the SQL query described by queryData and returns the results.
func (*Connector) ExecuteStatement ¶
func (c *Connector) ExecuteStatement( ctx context.Context, stmt string, args []any, ) (sqlconnector.Result, error)
ExecuteStatement runs a parameterized SQL statement with ordered positional arguments. Placeholders in stmt must use PostgreSQL $N notation matching the order of args.
func (*Connector) GetCapabilities ¶
func (c *Connector) GetCapabilities() sqlconnector.Capabilities
GetCapabilities returns the capabilities supported by PostgreSQL connector.
func (*Connector) IntrospectSchema ¶
IntrospectSchema retrieves the schema of the PostgreSQL database.
func (*Connector) SQLPoolStats ¶
SQLPoolStats returns a safe point-in-time snapshot of the underlying pool.
type Credentials ¶
type Credentials struct {
Username string `json:"username" validate:"required"`
Password string `json:"password" validate:"required"`
}
Credentials holds PostgreSQL authentication values.
type TableMetadataObserver ¶
type TableMetadataObserver struct {
sqlconnector.TableMetadataResource
}
func (TableMetadataObserver) AssessMetadata ¶
func (o TableMetadataObserver) AssessMetadata(raw json.RawMessage) (model.ProofVerdict, []model.ProofDiagnostic, error)
func (TableMetadataObserver) Description ¶
func (o TableMetadataObserver) Description() string
func (TableMetadataObserver) MatchesResource ¶
func (o TableMetadataObserver) MatchesResource(config, operation json.RawMessage, source bool) bool
func (TableMetadataObserver) Plan ¶
func (o TableMetadataObserver) Plan() (proofevidence.MetadataPlan, error)
func (TableMetadataObserver) ReadMetadata ¶
func (o TableMetadataObserver) ReadMetadata(ctx context.Context, transport proofevidence.MetadataIO, credential []byte, limits proofevidence.Limits) (json.RawMessage, int64, proofevidence.Outcome)
Click to show internal directories.
Click to hide internal directories.