sqlite functions from: https://www.sqlite.org/lang_aggfunc.html https://www.sqlite.org/lang_mathfunc.html https://www.sqlite.org/lang_corefunc.html
(name string)
| 11 | // https://www.sqlite.org/lang_corefunc.html |
| 12 | |
| 13 | func defaultSchema(name string) *catalog.Schema { |
| 14 | s := &catalog.Schema{Name: name} |
| 15 | s.Funcs = []*catalog.Function{ |
| 16 | // Aggregation Functions |
| 17 | { |
| 18 | Name: "AVG", |
| 19 | Args: []*catalog.Argument{ |
| 20 | { |
| 21 | Type: &ast.TypeName{Name: "any"}, |
| 22 | }, |
| 23 | }, |
| 24 | ReturnType: &ast.TypeName{Name: "real"}, |
| 25 | ReturnTypeNullable: true, |
| 26 | }, |
| 27 | { |
| 28 | Name: "COUNT", |
| 29 | Args: []*catalog.Argument{}, |
| 30 | ReturnType: &ast.TypeName{Name: "integer"}, |
| 31 | }, |
| 32 | { |
| 33 | Name: "COUNT", |
| 34 | Args: []*catalog.Argument{ |
| 35 | { |
| 36 | Type: &ast.TypeName{Name: "any"}, |
| 37 | }, |
| 38 | }, |
| 39 | ReturnType: &ast.TypeName{Name: "integer"}, |
| 40 | }, |
| 41 | { |
| 42 | Name: "GROUP_CONCAT", |
| 43 | Args: []*catalog.Argument{ |
| 44 | { |
| 45 | Type: &ast.TypeName{Name: "any"}, |
| 46 | }, |
| 47 | }, |
| 48 | ReturnType: &ast.TypeName{Name: "text"}, |
| 49 | }, |
| 50 | { |
| 51 | Name: "GROUP_CONCAT", |
| 52 | Args: []*catalog.Argument{ |
| 53 | { |
| 54 | Type: &ast.TypeName{Name: "any"}, |
| 55 | }, |
| 56 | { |
| 57 | Type: &ast.TypeName{Name: "text"}, |
| 58 | }, |
| 59 | }, |
| 60 | ReturnType: &ast.TypeName{Name: "text"}, |
| 61 | }, |
| 62 | { |
| 63 | Name: "MAX", |
| 64 | Args: []*catalog.Argument{ |
| 65 | { |
| 66 | Type: &ast.TypeName{Name: "any"}, |
| 67 | }, |
| 68 | }, |
| 69 | ReturnType: &ast.TypeName{Name: "any"}, |
| 70 | ReturnTypeNullable: true, |