Documentation ¶
Overview ¶
Package rules holds common rewrite rules
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddMissingArgument ¶
type AddMissingArgument struct { Function string Position int // 0-based position of argument in call args list Value ast.Node }
func (AddMissingArgument) String ¶
func (r AddMissingArgument) String() string
type CallKeyword ¶
type CallKeyword struct{}
CallKeyword protects call on keywords from identifier quoting.
Postgres parses some builtin functions as Keyword like COALESCE, CAST, etc. This rules protect these call from token rules. You should put this rule at end of the rule set.
func (CallKeyword) String ¶
func (CallKeyword) String() string
type QuoteBuiltins ¶
type QuoteBuiltins struct{}
QuoteBuiltins protects Postgres builtin functions case.
func (QuoteBuiltins) String ¶
func (QuoteBuiltins) String() string
type RemoveLastArgument ¶
type RemoveLastArgument struct { Function string Position int // 0-based position of argument in call args list }
func (RemoveLastArgument) String ¶
func (r RemoveLastArgument) String() string
type RenameConstant ¶
type RenameConstant struct {
From, To string
}
func (RenameConstant) String ¶
func (r RenameConstant) String() string
type RenameFunction ¶
type RenameFunction struct {
// From must be lower cased as lexer.Token.Normalize() lowers identifier.
From, To string
}
func (RenameFunction) String ¶
func (r RenameFunction) String() string
type ReplaceOperator ¶
type ReplaceOperator struct {
// From must be UPPER cased as lexer.Token.Normalize() uppers keywords.
From, To []string
}
func (ReplaceOperator) String ¶
func (r ReplaceOperator) String() string
Click to show internal directories.
Click to hide internal directories.