Documentation
¶
Index ¶
- func CreateMigrateDatabase(t *testing.T, dbFile string)
- func MigrateMySQLDatabase(t *testing.T, dbURL string)
- func MigratePostgresDatabase(t *testing.T, dbURL string)
- func MustParseURL(t *testing.T, us string) *url.URL
- func SetupMySQL(t *testing.T) (database.Querier, func())
- func SetupPostgres(t *testing.T) (database.Querier, func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMigrateDatabase ¶
CreateMigrateDatabase will create all necessary directories, and will create the sqlite3 database (if necessary) and migrate it.
func MigrateMySQLDatabase ¶ added in v0.6.0
MigrateMySQLDatabase will migrate the MySQL database using dbmate. The database URL should be in the format: mysql://user:password@host:port/database
func MigratePostgresDatabase ¶ added in v0.6.0
MigratePostgresDatabase will migrate the PostgreSQL database using dbmate. The database URL should be in the format: postgresql://user:password@host:port/database
func MustParseURL ¶ added in v0.0.14
MustParseURL parses the url (string) and returns or fails the test.
func SetupMySQL ¶ added in v0.7.2
SetupMySQL sets up a new temporary MySQL database for testing. It requires the NCPS_TEST_ADMIN_MYSQL_URL environment variable to be set. It returns a database connection and a cleanup function.
func SetupPostgres ¶ added in v0.7.2
SetupPostgres sets up a new temporary PostgreSQL database for testing. It requires the NCPS_TEST_ADMIN_POSTGRES_URL environment variable to be set. It returns a database connection and a cleanup function.
Types ¶
This section is empty.