mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 21:31:02 +00:00
27 lines
611 B
Go
27 lines
611 B
Go
package sql
|
|
|
|
import (
|
|
"github.com/drone/drone/store/datastore/sql/mysql"
|
|
"github.com/drone/drone/store/datastore/sql/postgres"
|
|
"github.com/drone/drone/store/datastore/sql/sqlite"
|
|
)
|
|
|
|
// Supported database drivers
|
|
const (
|
|
DriverSqlite = "sqlite3"
|
|
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 {
|
|
case DriverPostgres:
|
|
return postgres.Lookup(name)
|
|
case DriverMysql:
|
|
return mysql.Lookup(name)
|
|
default:
|
|
return sqlite.Lookup(name)
|
|
}
|
|
}
|