db

package
v0.0.0-...-414c732 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Establish

func Establish(module container.Module) (*gorm.DB, error)

func NewBigQueryModule

func NewBigQueryModule(
	projectId, dataset string,
) (container.Module, error)

func NewMysqlModule

func NewMysqlModule(
	host string,
	port int,
	username, password, database string,
) (container.Module, error)

func NewPgModule

func NewPgModule(
	host string,
	port int,
	username, password, database string,
) (container.Module, error)

func NewPgModuleWithSsl

func NewPgModuleWithSsl(
	host string,
	port int,
	username, password, database string,
) (container.Module, error)

func NewPgPoolModule

func NewPgPoolModule(
	host string,
	port int,
	username, password, database string,
) (container.Module, error)

func NewPgPoolModuleWithSsl

func NewPgPoolModuleWithSsl(
	host string,
	port int,
	username, password, database string,
) (container.Module, error)

Types

type Db

type Db interface {
	Establish() *gorm.DB
	Disconnect() error
}

func NewBigQuery

func NewBigQuery(
	projectId, dataset string,
	timeout time.Duration,
) (Db, error)

func NewMysql

func NewMysql(
	host string,
	port int,
	username, password, database string,
	timeout time.Duration,
	usePreparedStatement bool,
) (Db, error)

func NewPg

func NewPg(
	host string,
	port int,
	username, password, database string,
	timeout time.Duration,
	sslMode string,
	usePreparedStatement bool,
) (Db, error)

Jump to

Keyboard shortcuts

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