Documentation
¶
Overview ¶
Package sqlfix implements tools for automated SQL rewrites and migration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddedAlias ¶
AddedAlias records an alias added to a query column.
type AliasGenerator ¶
type AliasGenerator struct {
// contains filtered or unexported fields
}
AliasGenerator generates unique column aliases for SQL queries.
func NewAliasGenerator ¶
func NewAliasGenerator() *AliasGenerator
NewAliasGenerator creates a new AliasGenerator.
func (*AliasGenerator) Next ¶
func (g *AliasGenerator) Next(expr string) string
Next generates a deterministic, unique alias for the given expression.
func (*AliasGenerator) Reserve ¶
func (g *AliasGenerator) Reserve(alias string)
Reserve marks an alias as already used to prevent collisions.
type Report ¶
type Report struct {
Path string
Added []AddedAlias
Skipped []SkippedAlias
Warnings []string
ExpandedStars int
}
Report contains the results of a sqlfix run on a single file.
type Runner ¶
Runner executes the sqlfix logic on a set of files.
func (*Runner) CatalogWarnings ¶
CatalogWarnings returns any warnings encountered during catalog loading.
type SchemaCatalog ¶
SchemaCatalog holds the parsed database schema and any warnings.
func LoadSchemaCatalog ¶
func LoadSchemaCatalog(paths []string, readFile func(string) ([]byte, error)) (SchemaCatalog, error)
LoadSchemaCatalog loads and parses schema files from the given paths.
type SkippedAlias ¶
SkippedAlias records a column that could not be aliased.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package overrides handles conversion of sqlc configuration overrides to db-catalyst format.
|
Package overrides handles conversion of sqlc configuration overrides to db-catalyst format. |
|
Package sqlcconfig parses sqlc configuration files.
|
Package sqlcconfig parses sqlc configuration files. |