db

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDBEngine

func CreateDBEngine() (engine *xorm.Engine, err error)

CreateDBEngine initializes a db engine from the config

func CreateTestEngine

func CreateTestEngine() (engine *xorm.Engine, err error)

CreateTestEngine creates an instance of the db engine which lives in memory

func Dump added in v0.14.0

func Dump() (data map[string][]byte, err error)

Dump dumps all database tables

func InitFixtures

func InitFixtures(tablenames ...string) (err error)

InitFixtures initialize test fixtures for a test database

func InitTestFixtures

func InitTestFixtures(tablenames ...string) (err error)

InitTestFixtures populates the db with all fixtures from the fixtures folder

func LoadAndAssertFixtures

func LoadAndAssertFixtures(t *testing.T)

LoadAndAssertFixtures loads all fixtures defined before and asserts they are correctly loaded

func LoadFixtures

func LoadFixtures() error

LoadFixtures load fixtures for a test database

func RegisterTableStructsForCache

func RegisterTableStructsForCache(val interface{})

RegisterTableStructsForCache registers tables in gob encoding for redis cache

func Restore added in v0.14.0

func Restore(table string, contents []map[string]interface{}) (err error)

Restore restores a table with all its entries

func WipeEverything added in v0.14.0

func WipeEverything() error

WipeEverything wipes all tables and their data. Use with caution...

Types

This section is empty.

Jump to

Keyboard shortcuts

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