Documentation ¶
Index ¶
- func CreateTestDatabase(dbPath string, migrationFunctions []func(*gorm.DB) error, ...) (*gorm.DB, error)
- func CreateTestDatabasePostgres(dbUser, dbName string, migrationFunctions []func(*gorm.DB) error, ...) (*gorm.DB, error)
- func NewDatabase(cnf *config.Config) (*gorm.DB, error)
- type TimestampModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestDatabase ¶
func CreateTestDatabase(dbPath string, migrationFunctions []func(*gorm.DB) error, fixtureFiles []string) (*gorm.DB, error)
CreateTestDatabase recreates the test database and runs migrations and fixtures as passed in, returning a pointer to the database
func CreateTestDatabasePostgres ¶
func CreateTestDatabasePostgres(dbUser, dbName string, migrationFunctions []func(*gorm.DB) error, fixtureFiles []string) (*gorm.DB, error)
CreateTestDatabasePostgres is similar to CreateTestDatabase but it uses Postgres instead of sqlite, this is needed for testing packages that rely on some Postgres specifuc features (such as table inheritance)
func NewDatabase ¶
NewDatabase returns a gorm.DB struct, gorm.DB.DB() returns a database handle see http://golang.org/pkg/database/sql/#DB
Types ¶
Click to show internal directories.
Click to hide internal directories.