-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathmodels.go
More file actions
137 lines (122 loc) · 2.84 KB
/
models.go
File metadata and controls
137 lines (122 loc) · 2.84 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
package test
import (
"database/sql/driver"
"encoding/json"
"fmt"
"time"
)
type DebugCenum string
const (
DebugCenumOne DebugCenum = "one"
DebugCenumTwo DebugCenum = "two"
DebugCenumThree DebugCenum = "three"
)
func (e *DebugCenum) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = DebugCenum(s)
case string:
*e = DebugCenum(s)
default:
return fmt.Errorf("unsupported scan type for DebugCenum: %T", src)
}
return nil
}
type NullDebugCenum struct {
DebugCenum DebugCenum
Valid bool // Valid is true if DebugCenum is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullDebugCenum) Scan(value interface{}) error {
if value == nil {
ns.DebugCenum, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.DebugCenum.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullDebugCenum) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.DebugCenum), nil
}
type DebugCset string
const (
DebugCsetOne DebugCset = "one"
DebugCsetTwo DebugCset = "two"
DebugCsetThree DebugCset = "three"
)
func (e *DebugCset) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = DebugCset(s)
case string:
*e = DebugCset(s)
default:
return fmt.Errorf("unsupported scan type for DebugCset: %T", src)
}
return nil
}
type NullDebugCset struct {
DebugCset DebugCset
Valid bool // Valid is true if DebugCset is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullDebugCset) Scan(value interface{}) error {
if value == nil {
ns.DebugCset, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.DebugCset.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullDebugCset) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.DebugCset), nil
}
type Debug struct {
ID int64
Csmallint int16
Cint int32
Cinteger int32
Cdecimal string
Cnumeric string
Cfloat float64
Creal float64
Cdoubleprecision float64
Cdouble float64
Cdec string
Cfixed string
Ctinyint int32
Cbool bool
Cmediumint int32
Cbit interface{}
Cdate time.Time
Cdatetime time.Time
Ctimestamp time.Time
Ctime time.Time
Cyear int16
Cchar string
Cvarchar string
Cbinary []byte
Cvarbinary []byte
Ctinyblob []byte
Cblob []byte
Cmediumblob []byte
Clongblob []byte
Ctinytext string
Ctext string
Cmediumtext string
Clongtext string
Cenum NullDebugCenum
Cset DebugCset
Cjson json.RawMessage
}