-
Notifications
You must be signed in to change notification settings - Fork 0
/
vars.go
50 lines (45 loc) · 927 Bytes
/
vars.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 main
import (
"database/sql"
"sync"
)
type job struct {
query string
vals []interface{}
}
var (
sslMode, dbType, host, port, user, password, dbname string
db *sql.DB
err error
wg sync.WaitGroup
)
var validDBChoices = map[int]string{
1: "mysql",
2: "postgres",
3: "sqlite",
}
var validMysqlChoices = map[int]string{
1: "VARCHAR(60)",
2: "INT",
3: "FLOAT",
4: "DECIMAL",
5: "DATE",
6: "TIME",
}
var validPostgresChoices = map[int]string{
1: "varchar(60)",
2: "integer",
3: "float(12)",
4: "date",
5: "time(6)",
}
var validSqliteChoices = map[int]string{
1: "TEXT",
2: "INTEGER",
3: "DECIMAL",
}
var dbTypeChoices = map[string]map[int]string{
"mysql": validMysqlChoices,
"postgres": validPostgresChoices,
"sqlite": validSqliteChoices,
}