Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
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
PostgreSQL re-exports the vendor-agnostic wrappers; see database/internal/wrapper.
type Transaction ¶ added in v0.2.0
type Transaction = wrapper.Transaction