forked from sqlc-dev/sqlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
query.go
50 lines (41 loc) · 839 Bytes
/
query.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 compiler
import (
"github.com/timstudd/sqlc/internal/sql/ast"
)
type Function struct {
Rel *ast.FuncName
ReturnType *ast.TypeName
}
type Table struct {
Rel *ast.TableName
Columns []*Column
}
type Column struct {
Name string
DataType string
NotNull bool
IsArray bool
Comment string
Length *int
IsNamedParam bool
// XXX: Figure out what PostgreSQL calls `foo.id`
Scope string
Table *ast.TableName
TableAlias string
Type *ast.TypeName
skipTableRequiredCheck bool
}
type Query struct {
SQL string
Name string
Cmd string // TODO: Pick a better name. One of: one, many, exec, execrows
Columns []*Column
Params []Parameter
Comments []string
// XXX: Hack
Filename string
}
type Parameter struct {
Number int
Column *Column
}