Began work on real sql schema definitions, and migration engine

This commit is contained in:
Torkel Ödegaard
2015-01-17 21:40:22 +01:00
parent 9a29b04561
commit 1f987c1903
7 changed files with 201 additions and 6 deletions
@@ -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
}