postgres

package
v0.0.0-...-8c930d8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init opens the default PostgreSQL connection when PostgreSQL is enabled and selected as the default database, and makes it the default database that database.Database and database.DB use; otherwise it does nothing.

func New

func New(cfg config.Postgres) (*gorm.DB, error)

New creates and returns a new PostgreSQL database connection with the given configuration. With tracing configured on, the returned handle carries the GORM OpenTelemetry tracing plugin, so application-held instances passed to DatabaseOn, SelectOn, UnionAllOn, TransactionOn, and CleanupOn are traced like the default database. The pool runs under the connection limits of the [database] configuration, the same ones the default handle runs under.

Types

This section is empty.

Jump to

Keyboard shortcuts

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