forked from coocood/qbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialect.go
50 lines (28 loc) · 1.17 KB
/
dialect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package qbs
import (
"reflect"
)
type Dialect interface {
//Substitute "?" marker if database use other symbol as marker
substituteMarkers(query string) string
// Quote will quote identifiers in a SQL statement.
quote(s string) string
sqlType(f interface{}, size int) string
parseBool(value reflect.Value) bool
setModelValue(value reflect.Value, field reflect.Value) error
querySql(criteria *criteria) (sql string, args []interface{})
insert(q *Qbs) (int64, error)
insertSql(criteria *criteria) (sql string, args []interface{})
update(q *Qbs) (int64, error)
updateSql(criteria *criteria) (string, []interface{})
delete(q *Qbs) (int64, error)
deleteSql(criteria *criteria) (string, []interface{})
createTableSql(model *model, ifNotExists bool) string
dropTableSql(table string) string
addColumnSql(table, column string, typ interface{}, size int) string
createIndexSql(name, table string, unique bool, columns ...string) string
indexExists(mg *Migration, tableName string, indexName string) bool
columnsInTable(mg *Migration, tableName interface{}) map[string]bool
primaryKeySql(isString bool, size int) string
catchMigrationError(err error) bool
}