MCPcopy
hub / github.com/sqlc-dev/sqlc / New

Function New

internal/sql/catalog/catalog.go:21–34  ·  view source on GitHub ↗

New creates a new catalog

(defaultSchema string)

Source from the content-addressed store, hash-verified

19
20// New creates a new catalog
21func New(defaultSchema string) *Catalog {
22
23 newCatalog := &Catalog{
24 DefaultSchema: defaultSchema,
25 Schemas: make([]*Schema, 0),
26 Extensions: make(map[string]struct{}),
27 }
28
29 if newCatalog.DefaultSchema != "" {
30 newCatalog.Schemas = append(newCatalog.Schemas, &Schema{Name: defaultSchema})
31 }
32
33 return newCatalog
34}
35
36func (c *Catalog) Build(stmts []ast.Statement) error {
37 for i := range stmts {

Callers 2

NewCatalogFunction · 0.92
newTestCatalogFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected