2017-03-28 10:53:06 +02:00
|
|
|
package sql
|
|
|
|
|
|
|
|
import (
|
2017-03-28 11:13:13 +02:00
|
|
|
"github.com/drone/drone/store/datastore/sql/postgres"
|
2017-03-28 10:53:06 +02:00
|
|
|
"github.com/drone/drone/store/datastore/sql/sqlite"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Supported database drivers
|
|
|
|
const (
|
2017-03-28 11:13:13 +02:00
|
|
|
DriverSqlite = "sqlite3"
|
2017-03-28 10:53:06 +02:00
|
|
|
DriverMysql = "mysql"
|
|
|
|
DriverPostgres = "postgres"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Lookup returns the named sql statement compatible with
|
|
|
|
// the specified database driver.
|
|
|
|
func Lookup(driver string, name string) string {
|
|
|
|
switch driver {
|
2017-03-28 11:13:13 +02:00
|
|
|
case DriverPostgres:
|
|
|
|
return postgres.Lookup(name)
|
2017-03-28 10:53:06 +02:00
|
|
|
default:
|
|
|
|
return sqlite.Lookup(name)
|
|
|
|
}
|
|
|
|
}
|