pg_temp.go 592 B

12345678910111213141516171819202122232425262728
  1. package postgresql
  2. import (
  3. "github.com/kyleconroy/sqlc/internal/sql/ast"
  4. "github.com/kyleconroy/sqlc/internal/sql/catalog"
  5. )
  6. func pgTemp() *catalog.Schema {
  7. return &catalog.Schema{Name: "pg_temp"}
  8. }
  9. func typeName(name string) *ast.TypeName {
  10. return &ast.TypeName{Name: name}
  11. }
  12. func argN(name string, n int) *catalog.Function {
  13. var args []*catalog.Argument
  14. for i := 0; i < n; i++ {
  15. args = append(args, &catalog.Argument{
  16. Type: &ast.TypeName{Name: "any"},
  17. })
  18. }
  19. return &catalog.Function{
  20. Name: name,
  21. Args: args,
  22. ReturnType: &ast.TypeName{Name: "any"},
  23. }
  24. }