Exemple #1
0
func (s *MysqlTestSuite) SetupTest() {
	s.connection.Exec("DROP SCHEMA public CASCADE")
	s.connection.Exec("CREATE SCHEMA public")

	s.DriverTestSuite.Driver = mysql.New("mysql://" + CONNECTION_URL)
	s.DriverTestSuite.Reader = memory.NewMemoryReader(files)
}
Exemple #2
0
func getDriver(rawurl string) (driver.Driver, error) {
	u, err := url.Parse(rawurl)
	if err != nil {
		return nil, err
	}

	switch u.Scheme {
	case "cassandra":
		return cassandra.New(rawurl), nil
	case "postgres":
		return postgres.New(rawurl), nil
	case "mysql":
		return mysql.New(rawurl), nil
	case "sqlite3":
		return sqlite3.New(rawurl), nil
	}

	return nil, errors.New(fmt.Sprintf("Can't finde driver for scheme %s", u.Scheme))
}