postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package postgres adapts the gorm.io/driver/postgres driver (pgx) to gormdb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

Driver implements gormdb.PostgresDriver. The upstream dialector already translates constraint errors to gorm's sentinels while keeping the *pgconn.PgError, so no wrapper is needed.

To build the pool differently (credentials that rotate, a tracing wrapper), embed Driver in a type of your own and replace OpenDB.

func (Driver) Dialector

func (Driver) Dialector(conn gorm.ConnPool) gorm.Dialector

Dialector returns the gorm dialector over an open connection pool.

func (Driver) OpenDB

func (Driver) OpenDB(cfg gormdb.PostgresCfg) (*sql.DB, error)

OpenDB returns a pgx connection pool for cfg.DSN(). It does not connect.

Jump to

Keyboard shortcuts

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