db

package
Version: v0.0.0-...-f310763 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 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(db *gorm.DB, records ...interface{})

func ExecSql

func ExecSql(db *gorm.DB, sql string)

func TearDownDb

func TearDownDb(dbResource DbResource)

Types

type DbResource

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

func SetupDb

func SetupDb() DbResource

func (DbResource) GetDb

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

GetDb returns the sql db pool

func (DbResource) GetDbConfig

func (d DbResource) GetDbConfig() types.Db

GetDbConfig returns the db config of the session

func (DbResource) GetGormDb

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

GetGormDb creates a gorm db session

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL