forked from sqlc-dev/sqlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdlib.go
More file actions
32 lines (29 loc) · 719 Bytes
/
stdlib.go
File metadata and controls
32 lines (29 loc) · 719 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
package sqlite
import (
"github.com/kyleconroy/sqlc/internal/sql/ast"
"github.com/kyleconroy/sqlc/internal/sql/catalog"
)
// TODO: fill out sqlite functions from:
// https://www.sqlite.org/lang_aggfunc.html
// https://www.sqlite.org/lang_mathfunc.html
// https://www.sqlite.org/lang_corefunc.html
func defaultSchema(name string) *catalog.Schema {
s := &catalog.Schema{Name: name}
s.Funcs = []*catalog.Function{
{
Name: "COUNT",
Args: []*catalog.Argument{},
ReturnType: &ast.TypeName{Name: "bigint"},
},
{
Name: "COUNT",
Args: []*catalog.Argument{
{
Type: &ast.TypeName{Name: "any"},
},
},
ReturnType: &ast.TypeName{Name: "bigint"},
},
}
return s
}