forked from slicebit/qb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialect_sqlite.go
53 lines (42 loc) · 1.42 KB
/
dialect_sqlite.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
51
52
53
package qb
// SqliteDialect is a type of dialect that can be used with sqlite driver
type SqliteDialect struct {
escaping bool
}
// Escape wraps the string with escape characters of the dialect
func (d *SqliteDialect) Escape(str string) string {
return str
}
// EscapeAll wraps all elements of string array
func (d *SqliteDialect) EscapeAll(strings []string) []string {
return escapeAll(d, strings[0:])
}
// SetEscaping sets the escaping parameter of dialect
func (d *SqliteDialect) SetEscaping(escaping bool) {
d.escaping = escaping
}
// Escaping gets the escaping parameter of dialect
func (d *SqliteDialect) Escaping() bool {
return d.escaping
}
// Placeholder returns the placeholder for bindings in the sql
func (d *SqliteDialect) Placeholder() string {
return "?"
}
// Placeholders returns the placeholders for bindings in the sql
func (d *SqliteDialect) Placeholders(values ...interface{}) []string {
return placeholders(d, values...)
}
// AutoIncrement generates auto increment sql of current dialect
func (d *SqliteDialect) AutoIncrement() string {
//return "AUTOINCREMENT"
return ""
}
// Reset does nothing for the default driver
func (d *SqliteDialect) Reset() {}
// SupportsUnsigned returns whether driver supports unsigned type mappings or not
func (d *SqliteDialect) SupportsUnsigned() bool { return false }
// Driver returns the current driver of dialect
func (d *SqliteDialect) Driver() string {
return "sqlite3"
}