config

package
v0.0.0-...-e6c4605 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

View Source
const (
	DefaultModelsDir = "models"
	DefaultSeedsDir  = "seeds"
	DefaultMacrosDir = "macros"
)

Default configuration values.

View Source
const ConfigFileName = "leapsql.yaml"

ConfigFileName is the name of the config file.

View Source
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

func DefaultSchemaForType(dbType string) string

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

func FindProjectRoot(startDir string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL