postgres

package
v0.0.0-...-4fe8a44 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstance

func GetInstance() *pg

GetInstance returns the singleton instance. Will be nil if not yet initialized.

func Initialize

func Initialize(ctx context.Context, e engine.Engine, l logger.Logger, migConf migration.Config,
	dataMigConf datamigration.Config, projectLimit int) error

Initialize instantiates the singleton postgres storage backend. Will only initialize once. Will simply return nil if already initialized.

func New

func New(ctx context.Context, migConf migration.Config, dataMigConf datamigration.Config, l logger.Logger) (*sql.DB, error)

New returns a new sql.DB connector with the automatic default migrations applied.

func ProcessError

func ProcessError(err error) error

ProcessError is used to translate DB-related errors into the error types defined for our storage implementations.

Types

type Querier

type Querier interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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