Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeTableName ¶
NormalizeTableName removes backticks and quotes from table name
Types ¶
type ParsedQuery ¶
type ParsedQuery struct {
Original string
Type QueryType
Statement sqlparser.Statement
TableName string
CurrencyColumns []string
Values map[string]interface{}
NeedsTransform bool
}
ParsedQuery represents a parsed SQL query with metadata
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles SQL query parsing and analysis
func NewParser ¶
func NewParser(tableConfig config.TablesConfig) *Parser
NewParser creates a new SQL parser
func (*Parser) Parse ¶
func (p *Parser) Parse(query string) (*ParsedQuery, error)
Parse parses a SQL query and returns metadata
func (*Parser) RewriteForDualWrite ¶
func (p *Parser) RewriteForDualWrite(pq *ParsedQuery, convertedValues map[string]float64) (string, error)
RewriteForDualWrite rewrites a query to include shadow columns
type QueryType ¶
type QueryType int
QueryType represents the type of SQL query
func (QueryType) IsMutation ¶
IsMutation returns true if the query mutates data
Click to show internal directories.
Click to hide internal directories.