db

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDSN = errors.New("invalid or missing database configuration")

ErrInvalidDSN error is returned, when the DSN configuration is incorrect, or empty.

Functions

func LinkObjects

func LinkObjects(ctx context.Context, db *bun.DB, items []LinkFunction) error

LinkObjects links objects by using the provided LinkFunction items.

func NewFromConfig

func NewFromConfig(conf config.DatabaseConfig) (*bun.DB, error)

NewFromConfig creates a new bun.DB based on the provided config.DatabaseConfig spec.

Types

type LinkFunction

type LinkFunction func(ctx context.Context, db *bun.DB) error

LinkFunction is a function, which establishes relationships between models.

Jump to

Keyboard shortcuts

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