Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Version string `yaml:"version"`
Engine Engine `yaml:"engine"`
Schema []Source `yaml:"schema"`
Queries []Source `yaml:"queries"`
Migrations []MigrationSource `yaml:"migrations"`
Plugins []PluginConfig `yaml:"plugins"`
Options GlobalOptions `yaml:"options"`
}
Config is the root of a generation run, read from a YAML file.
type Engine ¶
type Engine string
Engine identifies the SQL dialect.
const EnginePostgreSQL Engine = "postgresql"
type GlobalOptions ¶
type GlobalOptions struct {
DefaultSchema string `yaml:"defaultSchema"`
SearchPath []string `yaml:"searchPath"`
TypeOverrides map[string]string `yaml:"typeOverrides"`
Strict bool `yaml:"strict"`
}
GlobalOptions are host-wide generation settings.
type MigrationSource ¶
MigrationSource points at a directory (or glob) of up-migration SQL files. Migrations are the sole source of schema DDL.
type PluginConfig ¶
type PluginConfig struct {
Name string `yaml:"name"`
Wasm string `yaml:"wasm"`
Binary string `yaml:"binary"`
Command string `yaml:"command"`
Args []string `yaml:"args"`
SHA256 string `yaml:"sha256"`
Out string `yaml:"out"`
Options map[string]any `yaml:"options"`
Env map[string]string `yaml:"env"`
Enabled *bool `yaml:"enabled"` // nil means true
}
PluginConfig describes one code-generation plugin.
func (PluginConfig) IsEnabled ¶
func (p PluginConfig) IsEnabled() bool
IsEnabled reports whether the plugin should run (default true when Enabled is nil).
type Source ¶
type Source struct {
File string `yaml:"file"`
Dir string `yaml:"dir"`
Inline string `yaml:"inline"`
Glob string `yaml:"glob"`
Recursive bool `yaml:"recursive"`
}
Source describes a single SQL input for named queries: either a file, a directory, inline SQL text, or a glob pattern applied to the current directory.
Click to show internal directories.
Click to hide internal directories.