db

package
v0.0.0-...-d47debc Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupDb

func CleanupDb(db *sql.DB)

CleanupDb cleans the data written to the db during tests

func CreateDbRecords

func CreateDbRecords(dbClient interfaces.DbClient, records ...interface{})

func ExecSql

func ExecSql(dbClient interfaces.DbClient, sqls ...string)

func TearDownDb

func TearDownDb(dbResource DbResource)

Types

type DbResource

type DbResource struct {
	// contains filtered or unexported fields
}

func SetupDb

func SetupDb(migrate bool) DbResource

func (DbResource) GetDb

func (d DbResource) GetDb() *sql.DB

GetDb returns the sql db pool

func (DbResource) GetDbConfig

func (d DbResource) GetDbConfig() config.Db

GetDbConfig returns the db config of the session

func (DbResource) GetGormDb

func (d DbResource) GetGormDb() *gorm.DB

GetGormDb creates a gorm db session

Jump to

Keyboard shortcuts

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