jet/tests/dbconfig/dbconfig.go

37 lines
1 KiB
Go
Raw Normal View History

2019-06-11 12:47:35 +02:00
package dbconfig
import (
"fmt"
"github.com/go-jet/jet/v2/tests/internal/utils/repo"
)
2019-06-11 12:47:35 +02:00
2019-07-29 18:08:53 +02:00
// Postgres test database connection parameters
2019-06-11 12:47:35 +02:00
const (
PgHost = "localhost"
PgPort = 5432
PgUser = "jet"
PgPassword = "jet"
PgDBName = "jetdb"
2019-06-11 12:47:35 +02:00
)
2019-07-29 18:08:53 +02:00
// PostgresConnectString is PostgreSQL test database connection string
var PostgresConnectString = fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", PgHost, PgPort, PgUser, PgPassword, PgDBName)
2019-07-29 18:08:53 +02:00
// MySQL test database connection parameters
const (
MySqLHost = "localhost"
MySQLPort = 3306
MySQLUser = "jet"
MySQLPassword = "jet"
)
2019-08-17 18:32:01 +02:00
// MySQLConnectionString is MySQL driver connection string to test database
2019-07-29 18:08:53 +02:00
var MySQLConnectionString = fmt.Sprintf("%s:%s@tcp(%s:%d)/", MySQLUser, MySQLPassword, MySqLHost, MySQLPort)
// sqllite
var (
SakilaDBPath = repo.GetTestDataFilePath("/init/sqlite/sakila.db")
ChinookDBPath = repo.GetTestDataFilePath("/init/sqlite/chinook.db")
TestSampleDBPath = repo.GetTestDataFilePath("/init/sqlite/test_sample.db")
)