-
Notifications
You must be signed in to change notification settings - Fork 13
/
types.go
36 lines (29 loc) · 984 Bytes
/
types.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
package bqb
// Dialect holds the Query dialect
type Dialect string
const (
// PGSQL postgres dialect
PGSQL Dialect = "postgres"
// MYSQL MySQL dialect
MYSQL Dialect = "mysql"
// RAW dialect uses no parameter conversion
RAW Dialect = "raw"
// SQL generic dialect
SQL Dialect = "sql"
paramPh = "{{xX_PARAM_Xx}}"
)
// Embedded is a string type that is directly embedded into the query.
// Note: Like Embedder, this is not to be used for untrusted input.
type Embedded string
// Embedder embeds a value directly into a query string.
// Note: Since this is embedded and not bound,
// attention must be paid to sanitizing this input.
type Embedder interface {
RawValue() string
}
// JsonMap is a custom type which tells bqb to convert the parameter to
// a JSON object without requiring reflection.
type JsonMap map[string]interface{}
// JsonList is a type that tells bqb to convert the parameter to a JSON
// list without requiring reflection.
type JsonList []interface{}