-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
55 lines (49 loc) · 786 Bytes
/
main.go
File metadata and controls
55 lines (49 loc) · 786 Bytes
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
package main
import (
_ "github.com/lib/pq"
"github.com/jmoiron/sqlx"
)
type Category struct{
Id int `db:"cat_id"`
Label string `db:"cat_label"`
}
type Class struct{
Id int
Parent int
ShortDesc string
LongDesc string
Name string
}
type Method struct{
Id int
Owner int
Name string
ShortDesc string
LongDesc string
ReturnType string
Qualifiers string
}
type Argument struct{
Id int
Owner int
Position int
Name string
ShortDesc string
Type string
DefaultValue string
}
type Constant struct{
Id int
Owner int
Name string
Value string
}
func main() {
db:=sqlx.MustOpen("postgres","user=godotdoc dbname=godotdoc password=1234 sslmode=disable")
defer db.Close()
db.Ping()
_,e:=db.Exec(`INSERT INTO categories(label) VALUES(?)`)
if e!=nil {
panic(e)
}
}