Documentation
¶
Index ¶
- Variables
- func ValidateDialect(dialect string) error
- func ValidateIndent(indent int) error
- func ValidateMaxLineLength(length int) error
- func ValidateOutputFormat(format string) error
- type AnalyzeConfig
- type AnalyzeSchema
- type Config
- type ConfigSchema
- type FormatConfig
- type FormatSchema
- type OutputConfig
- type OutputSchema
- type SecurityConfig
- type ValidationConfig
- type ValidationSchema
Constants ¶
This section is empty.
Variables ¶
var ValidDialects = []string{
"postgresql",
"mysql",
"sqlserver",
"oracle",
"sqlite",
"generic",
}
ValidDialects lists all supported SQL dialects
var ValidOutputFormats = []string{
"json",
"yaml",
"table",
"tree",
"auto",
}
ValidOutputFormats lists all supported output formats
Functions ¶
func ValidateDialect ¶
ValidateDialect checks if a dialect is valid
func ValidateIndent ¶
ValidateIndent checks if indent value is within acceptable range
func ValidateMaxLineLength ¶
ValidateMaxLineLength checks if max line length is within acceptable range
func ValidateOutputFormat ¶
ValidateOutputFormat checks if an output format is valid
Types ¶
type AnalyzeConfig ¶
type AnalyzeConfig struct {
Security bool `yaml:"security"`
Performance bool `yaml:"performance"`
Complexity bool `yaml:"complexity"`
All bool `yaml:"all"`
}
AnalyzeConfig holds analysis options
type AnalyzeSchema ¶
type AnalyzeSchema struct {
Security struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"security"`
Performance struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"performance"`
Complexity struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"complexity"`
All struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"all"`
}
AnalyzeSchema defines constraints for analyze settings
type Config ¶
type Config struct {
Format FormatConfig `yaml:"format"`
Validation ValidationConfig `yaml:"validate"`
Output OutputConfig `yaml:"output"`
Analyze AnalyzeConfig `yaml:"analyze"`
}
Config represents the complete GoSQLX CLI configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a configuration with sensible defaults
func LoadDefault ¶
LoadDefault tries to load configuration from standard locations with precedence Priority order: 1. Current directory: .gosqlx.yml 2. Home directory: ~/.gosqlx.yml 3. System: /etc/gosqlx.yml Returns default config if no file is found
func (*Config) Merge ¶
Merge applies settings from another config, with the other config taking precedence
type ConfigSchema ¶
type ConfigSchema struct {
Format FormatSchema `yaml:"format"`
Validation ValidationSchema `yaml:"validate"`
Output OutputSchema `yaml:"output"`
Analyze AnalyzeSchema `yaml:"analyze"`
}
ConfigSchema defines the structure and constraints for configuration
func GetSchema ¶
func GetSchema() *ConfigSchema
GetSchema returns the complete configuration schema with descriptions
type FormatConfig ¶
type FormatConfig struct {
Indent int `yaml:"indent"`
UppercaseKeywords bool `yaml:"uppercase_keywords"`
MaxLineLength int `yaml:"max_line_length"`
Compact bool `yaml:"compact"`
}
FormatConfig holds formatting options
type FormatSchema ¶
type FormatSchema struct {
Indent struct {
Min int `yaml:"min"`
Max int `yaml:"max"`
Default int `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"indent"`
UppercaseKeywords struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"uppercase_keywords"`
MaxLineLength struct {
Min int `yaml:"min"`
Max int `yaml:"max"`
Default int `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"max_line_length"`
Compact struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"compact"`
}
FormatSchema defines constraints for format settings
type OutputConfig ¶
type OutputConfig struct {
Format string `yaml:"format"` // json, yaml, table
Verbose bool `yaml:"verbose"`
}
OutputConfig holds output formatting options
type OutputSchema ¶
type OutputSchema struct {
Format struct {
Options []string `yaml:"options"`
Default string `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"format"`
Verbose struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"verbose"`
}
OutputSchema defines constraints for output settings
type SecurityConfig ¶
type SecurityConfig struct {
MaxFileSize int64 `yaml:"max_file_size"` // Maximum file size in bytes
}
SecurityConfig holds security-related limits
type ValidationConfig ¶
type ValidationConfig struct {
Dialect string `yaml:"dialect"`
StrictMode bool `yaml:"strict_mode"`
Recursive bool `yaml:"recursive"`
Pattern string `yaml:"pattern"`
Security SecurityConfig `yaml:"security"`
}
ValidationConfig holds validation options
type ValidationSchema ¶
type ValidationSchema struct {
Dialect struct {
Options []string `yaml:"options"`
Default string `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"dialect"`
StrictMode struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"strict_mode"`
Recursive struct {
Default bool `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"recursive"`
Pattern struct {
Default string `yaml:"default"`
Desc string `yaml:"description"`
} `yaml:"pattern"`
}
ValidationSchema defines constraints for validation settings