1
0

catalog.go 589 B

123456789101112131415161718192021
  1. package postgresql
  2. import "github.com/kyleconroy/sqlc/internal/sql/catalog"
  3. func NewCatalog() *catalog.Catalog {
  4. c := catalog.New("public")
  5. c.Schemas = append(c.Schemas, pgTemp())
  6. c.Schemas = append(c.Schemas, genPGCatalog())
  7. c.SearchPath = []string{"pg_catalog"}
  8. c.LoadExtension = loadExtension
  9. return c
  10. }
  11. // The generated pg_catalog is very slow to compare because it has so
  12. // many entries. For testing, don't include it.
  13. func newTestCatalog() *catalog.Catalog {
  14. c := catalog.New("public")
  15. c.Schemas = append(c.Schemas, pgTemp())
  16. c.LoadExtension = loadExtension
  17. return c
  18. }