Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabaseName ¶
GetDatabaseName parse the database name (or MaxCompute project) from the database connection string
func GetSessionFromTestingDB ¶
GetSessionFromTestingDB construct a proto message Session representing the testing database configuration.
func GetTestingHiveURL ¶ added in v0.4.2
func GetTestingHiveURL() string
GetTestingHiveURL reutrns Hive connection URL
func GetTestingMySQLConfig ¶
GetTestingMySQLConfig construct a MySQL config
func GetTestingMySQLURL ¶
func GetTestingMySQLURL() string
GetTestingMySQLURL returns MySQL connection URL
Types ¶
type DB ¶
type DB struct {
DriverName string // NOTE: Don't name it Driver, because Driver is a method of sql.DB.
DataSourceName string
*sql.DB
}
DB extends sql.DB, while keeping the two parameters, DriverName and DataSource, to database/sql.Open reaccessible.
func GetTestingDBSingleton ¶
func GetTestingDBSingleton() *DB
GetTestingDBSingleton returns the testing DB singleton.
func OpenAndConnectDB ¶
OpenAndConnectDB calls OpenDB to open a database specified by an URL. In addition to opening, it also call database.DB.Ping to ensure a connection to the database.