-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.go
57 lines (49 loc) · 1.11 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package korm
import (
"database/sql"
)
const (
MIGRATION_FOLDER = "migrations"
SQLITE Dialect = "sqlite3"
POSTGRES Dialect = "postgres"
MYSQL Dialect = "mysql"
MARIA Dialect = "maria"
COCKROACH Dialect = "cockroach"
)
// Dialect db dialects are SQLITE, POSTGRES, MYSQL, MARIA, COCKROACH
type Dialect = string
// DatabaseEntity hold table state
type TableEntity struct {
Types map[string]string
ModelTypes map[string]string
Tags map[string][]string
Columns []string
Fkeys []kormFkey
Pk string
Name string
}
// DatabaseEntity hold memory db state
type DatabaseEntity struct {
Tables []TableEntity
Name string
Dialect string
Conn *sql.DB
}
type dbCache struct {
limit int
page int
database string
table string
selected string
orderBys string
whereQuery string
offset string
statement string
args string
}
type DocsSuccess struct {
Success string `json:"success" example:"success message"`
}
type DocsError struct {
Error string `json:"error" example:"error message"`
}