func mysqlOpener(url *config.URL) (driver.Driver, error) { url.Query["charset"] = "UTF8" url.Query["sql_mode"] = "ANSI" url.Query["parseTime"] = "true" url.Query["loc"] = "UTC" url.Query["clientFoundRows"] = "true" return sql.NewDriver(mysqlBackend, url) }
func sqliteOpener(url *config.URL) (driver.Driver, error) { drv, err := sql.NewDriver(sqliteBackend, url) if err == nil { db := drv.DB() if _, err := db.Exec("PRAGMA foreign_keys = on"); err != nil { return nil, err } if _, err := db.Exec("PRAGMA journal_mode = WAL"); err != nil { return nil, err } } return drv, err }
func postgresOpener(url *config.URL) (driver.Driver, error) { return sql.NewDriver(postgresBackend, url) }