Documentation
¶
Overview ¶
Package config provides shared configuration types for LeapSQL. This package is decoupled from CLI concerns and can be used by the LSP and other tools that need to load project configuration.
Note: Core types are now defined in pkg/core. New code should import pkg/core directly for type definitions.
Index ¶
Constants ¶
const ( DefaultModelsDir = "models" DefaultSeedsDir = "seeds" DefaultMacrosDir = "macros" )
Default configuration values.
const ConfigFileName = "leapsql.yaml"
ConfigFileName is the name of the config file.
const ConfigFileNameAlt = "leapsql.yml"
ConfigFileNameAlt is the alternate name of the config file.
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaults ¶
func ApplyDefaults(c *core.ProjectConfig)
ApplyDefaults applies default values to a ProjectConfig.
func ApplyTargetDefaults ¶
func ApplyTargetDefaults(t *core.TargetConfig)
ApplyTargetDefaults applies default values to a TargetConfig based on the target type.
func DefaultSchemaForType ¶
DefaultSchemaForType returns the default schema for a database type. It looks up the dialect in the registry; if not found, returns "main" as fallback.
func FindProjectRoot ¶
FindProjectRoot walks up from the given directory to find a directory containing leapsql.yaml or leapsql.yml. Returns empty string if not found.
func LoadFromDir ¶
func LoadFromDir(dir string) (*core.ProjectConfig, error)
LoadFromDir loads a ProjectConfig from the given directory. It looks for leapsql.yaml or leapsql.yml in the directory. Returns nil, nil if no config file is found (not an error condition).
func ValidateTarget ¶
func ValidateTarget(t *core.TargetConfig) error
ValidateTarget checks if the target configuration is valid. It uses the adapter registry to determine which adapter types are available.
Types ¶
This section is empty.