1
0

catalog.go 540 B

12345678910111213141516171819
  1. package postgresql
  2. import "github.com/sqlc-dev/sqlc/internal/sql/catalog"
  3. // toPointer converts an int to a pointer without a temporary
  4. // variable at the call-site, and is used by the generated schemas
  5. func toPointer(x int) *int {
  6. return &x
  7. }
  8. func NewCatalog() *catalog.Catalog {
  9. c := catalog.New("public")
  10. c.Schemas = append(c.Schemas, pgTemp())
  11. c.Schemas = append(c.Schemas, genPGCatalog())
  12. c.Schemas = append(c.Schemas, genInformationSchema())
  13. c.SearchPath = []string{"pg_catalog"}
  14. c.LoadExtension = loadExtension
  15. return c
  16. }