stdlib.go 719 B

1234567891011121314151617181920212223242526272829303132
  1. package sqlite
  2. import (
  3. "github.com/kyleconroy/sqlc/internal/sql/ast"
  4. "github.com/kyleconroy/sqlc/internal/sql/catalog"
  5. )
  6. // TODO: fill out sqlite functions from:
  7. // https://www.sqlite.org/lang_aggfunc.html
  8. // https://www.sqlite.org/lang_mathfunc.html
  9. // https://www.sqlite.org/lang_corefunc.html
  10. func defaultSchema(name string) *catalog.Schema {
  11. s := &catalog.Schema{Name: name}
  12. s.Funcs = []*catalog.Function{
  13. {
  14. Name: "COUNT",
  15. Args: []*catalog.Argument{},
  16. ReturnType: &ast.TypeName{Name: "bigint"},
  17. },
  18. {
  19. Name: "COUNT",
  20. Args: []*catalog.Argument{
  21. {
  22. Type: &ast.TypeName{Name: "any"},
  23. },
  24. },
  25. ReturnType: &ast.TypeName{Name: "bigint"},
  26. },
  27. }
  28. return s
  29. }