2019-06-11 12:47:35 +02:00
|
|
|
package dbconfig
|
|
|
|
|
|
2021-10-21 13:39:24 +02:00
|
|
|
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 (
|
2021-07-27 17:39:21 +02:00
|
|
|
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
|
2021-07-27 17:39:21 +02:00
|
|
|
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)
|
2021-10-21 13:39:24 +02:00
|
|
|
|
|
|
|
|
// sqllite
|
|
|
|
|
var (
|
|
|
|
|
SakilaDBPath = repo.GetTestDataFilePath("/init/sqlite/sakila.db")
|
|
|
|
|
ChinookDBPath = repo.GetTestDataFilePath("/init/sqlite/chinook.db")
|
|
|
|
|
TestSampleDBPath = repo.GetTestDataFilePath("/init/sqlite/test_sample.db")
|
|
|
|
|
)
|