postgres

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config pkdb.Config

func (*Config) AfterInject

func (c *Config) AfterInject()

AfterInject delegates to the parent gormdb Config.

func (*Config) BeforeInjectWithRoot

func (c *Config) BeforeInjectWithRoot(conf *initialize.RootConfig)

BeforeInjectWithRoot delegates to the parent gormdb Config.

func (*Config) Build

func (c *Config) Build() (*gorm.DB, error)

Build constructs a PostgreSQL DSN and opens a GORM DB connection.

type DB

type DB pkdb.DB

func (*DB) Close

func (db *DB) Close() error

Close closes the underlying sql.DB connection.

func (*DB) Config

func (db *DB) Config() any

Config returns the embedded Conf as the configuration for injection.

func (*DB) Init

func (db *DB) Init() error

Init opens the PostgreSQL connection and stores it in DB.

func (*DB) Table

func (db *DB) Table(name string) *gorm.DB

Table returns a *gorm.DB scoped to the given table name (with schema prefix if configured).

func (*DB) TableName

func (db *DB) TableName(name string) string

TableName returns the schema-qualified table name when a Postgres schema is configured.

Jump to

Keyboard shortcuts

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