Documentation
¶
Overview ¶
Package sqld is the public API for the sqld engine: parse PostgreSQL sources into the semantic IR (a Catalog) and run code-generation plugins against it.
Typical use:
cfg, err := sqld.LoadConfig("sqld.yaml")
if err != nil { ... }
cat, err := sqld.Collect(cfg) // schema + migrations -> IR
// or
err = sqld.Generate(cfg) // Collect, then run the configured plugins
The IR and plugin contract messages are protobuf types under github.com/gopherex/sqld/pkg/proto/sqld/v1/{ir,plugin}. The config is a plain Go struct under github.com/gopherex/sqld/pkg/config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectFile ¶
CollectFile loads a config file and collects the IR Catalog from it.
func Generate ¶
Generate runs Collect and then drives the configured plugins, writing their output files to disk.
func GenerateFile ¶
GenerateFile loads a config file and runs generation from it.
Types ¶
type Config ¶
Config re-exports the config type for callers who import only pkg/sqld.
func LoadConfig ¶
LoadConfig reads and parses a YAML config file into a Config struct.
type Diagnostic ¶
Diagnostic is a non-fatal issue surfaced while building the IR (e.g. an unresolved column type or an unhandled statement).
type Result ¶
type Result struct {
Catalog *irv1.Catalog
Queries []*pluginv1.Query
Migrations []*pluginv1.Migration
Diagnostics []Diagnostic
}
Result is the full output of a collection pass.
func CollectAll ¶
CollectAll runs the full pipeline and returns the Catalog together with the inferred queries, parsed migrations, and any diagnostics.