-
Notifications
You must be signed in to change notification settings - Fork 73
/
createdb_stmt.go
46 lines (37 loc) · 1009 Bytes
/
createdb_stmt.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
// Auto-generated from postgres/src/include/nodes/parsenodes.h - DO NOT EDIT
package pg_query
import "encoding/json"
/* ----------------------
* Createdb Statement
* ----------------------
*/
type CreatedbStmt struct {
Dbname *string `json:"dbname"` /* name of database to create */
Options List `json:"options"` /* List of DefElem nodes */
}
func (node CreatedbStmt) MarshalJSON() ([]byte, error) {
type CreatedbStmtMarshalAlias CreatedbStmt
return json.Marshal(map[string]interface{}{
"CreatedbStmt": (*CreatedbStmtMarshalAlias)(&node),
})
}
func (node *CreatedbStmt) UnmarshalJSON(input []byte) (err error) {
var fields map[string]json.RawMessage
err = json.Unmarshal(input, &fields)
if err != nil {
return
}
if fields["dbname"] != nil {
err = json.Unmarshal(fields["dbname"], &node.Dbname)
if err != nil {
return
}
}
if fields["options"] != nil {
node.Options.Items, err = UnmarshalNodeArrayJSON(fields["options"])
if err != nil {
return
}
}
return
}