-
Notifications
You must be signed in to change notification settings - Fork 73
/
mssql.go
44 lines (33 loc) · 955 Bytes
/
mssql.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
// Package mssql implements reform.Dialect for Microsoft SQL Server (mssql driver).
package mssql // import "gopkg.in/reform.v1/dialects/mssql"
import "gopkg.in/reform.v1"
type mssql struct{}
func (mssql) String() string {
return "mssql"
}
func (mssql) Placeholder(index int) string {
return "?"
}
func (mssql) Placeholders(start, count int) []string {
res := make([]string, count)
for i := 0; i < count; i++ {
res[i] = "?"
}
return res
}
func (mssql) QuoteIdentifier(identifier string) string {
return "[" + identifier + "]"
}
func (mssql) LastInsertIdMethod() reform.LastInsertIdMethod {
return reform.OutputInserted
}
func (mssql) SelectLimitMethod() reform.SelectLimitMethod {
return reform.SelectTop
}
func (mssql) DefaultValuesMethod() reform.DefaultValuesMethod {
return reform.DefaultValues
}
// Dialect implements reform.Dialect for Microsoft SQL Server.
var Dialect mssql
// check interface
var _ reform.Dialect = Dialect