Began work on real sql schema definitions, and migration engine
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package sqlsyntax
|
||||
|
||||
type Dialect interface {
|
||||
DBType() string
|
||||
TableCheckSql(tableName string) (string, []interface{})
|
||||
}
|
||||
|
||||
type Sqlite3 struct {
|
||||
}
|
||||
|
||||
func (db *Sqlite3) DBType() string {
|
||||
return "sqlite3"
|
||||
}
|
||||
|
||||
func (db *Sqlite3) TableCheckSql(tableName string) (string, []interface{}) {
|
||||
args := []interface{}{tableName}
|
||||
return "SELECT name FROM sqlite_master WHERE type='table' and name = ?", args
|
||||
}
|
||||
Reference in New Issue
Block a user