Documentation
¶
Overview ¶
Package config loads and validates the db-catalyst configuration.
Index ¶
- type Cache
- type CacheConfig
- type ColumnOverride
- type Config
- type CustomTypeMapping
- type CustomTypesConfig
- type Database
- type DatabaseTypeOverride
- type Driver
- type GenerationOptions
- type GoTypeDetails
- type JobPlan
- type Language
- type LoadOptions
- type OverridesConfig
- type PreparedQueries
- type PreparedQueriesConfig
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
CacheConfig captures caching configuration for incremental builds.
type ColumnOverride ¶
type ColumnOverride struct {
Column string `toml:"column"`
GoType any `toml:"go_type"` // Can be string or complex object
}
ColumnOverride defines column-specific type overrides (sqlc compatibility).
type Config ¶
type Config struct {
Package string `toml:"package"`
Out string `toml:"out"`
Language Language `toml:"language"`
Database Database `toml:"database"`
SQLiteDriver Driver `toml:"sqlite_driver"`
Schemas []string `toml:"schemas"`
Queries []string `toml:"queries"`
CustomTypes CustomTypesConfig `toml:"custom_types"`
Generation GenerationOptions `toml:"generation"`
PreparedQueries PreparedQueriesConfig `toml:"prepared_queries"`
Cache CacheConfig `toml:"cache"`
}
Config mirrors the expected db-catalyst TOML schema.
type CustomTypeMapping ¶
type CustomTypeMapping struct {
CustomType string `toml:"custom_type"`
SQLiteType string `toml:"sqlite_type"`
GoType string `toml:"go_type"`
GoImport string `toml:"go_import"`
GoPackage string `toml:"go_package"`
Pointer bool `toml:"pointer"`
}
CustomTypeMapping defines how a custom type maps to SQLite and Go types.
type CustomTypesConfig ¶
type CustomTypesConfig struct {
Mappings []CustomTypeMapping `toml:"mapping"`
}
CustomTypesConfig captures custom type mappings.
type DatabaseTypeOverride ¶
type DatabaseTypeOverride struct {
DatabaseType string `toml:"db_type"`
GoType string `toml:"go_type"`
}
DatabaseTypeOverride defines db_type to go_type mappings (sqlc compatibility).
type GenerationOptions ¶
type GenerationOptions struct {
EmitEmptySlices bool `toml:"emit_empty_slices"`
EmitPreparedQueries bool `toml:"emit_prepared_queries"`
EmitJSONTags bool `toml:"emit_json_tags"`
EmitPointersForNull bool `toml:"emit_pointers_for_null"`
SQLDialect string `toml:"sql_dialect"`
}
GenerationOptions captures additional generation options.
type GoTypeDetails ¶
type GoTypeDetails struct {
Import string `toml:"import"`
Package string `toml:"package"`
Type string `toml:"type"`
Pointer bool `toml:"pointer"`
}
GoTypeDetails captures complex go_type configuration (sqlc compatibility).
type JobPlan ¶
type JobPlan struct {
Package string
Out string
Language Language
Database Database
SQLiteDriver Driver
Schemas []string
Queries []string
CustomTypes []CustomTypeMapping
EmitJSONTags bool
EmitPointersForNull bool
PreparedQueries PreparedQueries
SQLDialect string
Cache Cache
}
JobPlan is the fully-resolved configuration used by downstream stages.
type Language ¶
type Language string
Language identifies the target programming language for code generation.
type LoadOptions ¶
type LoadOptions struct {
Strict bool
Resolver *fileset.Resolver
// Logger receives warning messages. If nil, warnings are only added to Result.Warnings.
Logger logging.Logger
}
LoadOptions tunes config loading behavior.
type OverridesConfig ¶
type OverridesConfig struct {
DatabaseTypes []DatabaseTypeOverride `toml:"overrides"`
Columns []ColumnOverride `toml:"overrides"`
}
OverridesConfig captures sqlc-style overrides.
type PreparedQueries ¶
PreparedQueries is the normalized configuration forwarded to the pipeline.