postgresql

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(cfg *config.DatabaseConfig, log logger.Logger) (types.Interface, error)

NewConnection creates and configures a PostgreSQL Connection using cfg and log. It validates cfg, builds or uses the provided DSN, sets pool options, ensures connectivity with a ping, logs success, and returns the wrapped Connection or an error.

Types

type Connection

type Connection struct {
	*wrapper.Connection
}

Connection implements the types.Interface for PostgreSQL. Embeds the vendor-agnostic wrapper.Connection which carries the byte-identical delegation methods (Query, Exec, Prepare, Begin, Health, Stats, Close, etc.) — see database/internal/wrapper. PostgreSQL-only methods (DatabaseType, MigrationTable, CreateMigrationTable DDL) stay defined here.

func (*Connection) CreateMigrationTable

func (c *Connection) CreateMigrationTable(ctx context.Context) error

CreateMigrationTable creates the migration table if it doesn't exist

func (*Connection) DatabaseType

func (c *Connection) DatabaseType() string

DatabaseType returns the database type

func (*Connection) MigrationTable added in v0.19.0

func (c *Connection) MigrationTable() string

MigrationTable returns the migration table name for PostgreSQL

type Statement added in v0.2.0

type Statement = wrapper.Statement

PostgreSQL re-exports the vendor-agnostic wrappers; see database/internal/wrapper.

type Transaction added in v0.2.0

type Transaction = wrapper.Transaction

Jump to

Keyboard shortcuts

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