Documentation ¶
Index ¶
- func New(systemTablePrefixes []string, opts ...parsing.Option) (parsing.SQLValidator, error)
- func NewInstrumentedSQLValidator(p parsing.SQLValidator) (parsing.SQLValidator, error)
- type InstrumentedSQLValidator
- func (ip *InstrumentedSQLValidator) ValidateCreateTable(query string, chainID tableland.ChainID) (parsing.CreateStmt, error)
- func (ip *InstrumentedSQLValidator) ValidateMutatingQuery(query string, chainID tableland.ChainID) ([]parsing.MutatingStmt, error)
- func (ip *InstrumentedSQLValidator) ValidateReadQuery(query string) (parsing.ReadStmt, error)
- type QueryValidator
- func (pp *QueryValidator) ValidateCreateTable(query string, chainID tableland.ChainID) (parsing.CreateStmt, error)
- func (pp *QueryValidator) ValidateMutatingQuery(query string, chainID tableland.ChainID) ([]parsing.MutatingStmt, error)
- func (pp *QueryValidator) ValidateReadQuery(query string) (parsing.ReadStmt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInstrumentedSQLValidator ¶
func NewInstrumentedSQLValidator(p parsing.SQLValidator) (parsing.SQLValidator, error)
NewInstrumentedSQLValidator returns creates a wrapped QueryValidator for registering metrics.
Types ¶
type InstrumentedSQLValidator ¶
type InstrumentedSQLValidator struct {
// contains filtered or unexported fields
}
InstrumentedSQLValidator implements an instrumented Parsing interface.
func (*InstrumentedSQLValidator) ValidateCreateTable ¶
func (ip *InstrumentedSQLValidator) ValidateCreateTable( query string, chainID tableland.ChainID, ) (parsing.CreateStmt, error)
ValidateCreateTable register metrics for its corresponding wrapped parser.
func (*InstrumentedSQLValidator) ValidateMutatingQuery ¶
func (ip *InstrumentedSQLValidator) ValidateMutatingQuery( query string, chainID tableland.ChainID, ) ([]parsing.MutatingStmt, error)
ValidateMutatingQuery register metrics for its corresponding wrapped parser.
func (*InstrumentedSQLValidator) ValidateReadQuery ¶
func (ip *InstrumentedSQLValidator) ValidateReadQuery(query string) (parsing.ReadStmt, error)
ValidateReadQuery register metrics for its corresponding wrapped parser.
type QueryValidator ¶
type QueryValidator struct {
// contains filtered or unexported fields
}
QueryValidator enforces the Tablealand SQL spec.
func (*QueryValidator) ValidateCreateTable ¶
func (pp *QueryValidator) ValidateCreateTable(query string, chainID tableland.ChainID) (parsing.CreateStmt, error)
ValidateCreateTable validates a CREATE TABLE statement.
func (*QueryValidator) ValidateMutatingQuery ¶
func (pp *QueryValidator) ValidateMutatingQuery( query string, chainID tableland.ChainID, ) ([]parsing.MutatingStmt, error)
ValidateMutatingQuery validates a mutating-query, and a list of mutating statements contained in it.
func (*QueryValidator) ValidateReadQuery ¶
func (pp *QueryValidator) ValidateReadQuery(query string) (parsing.ReadStmt, error)
ValidateReadQuery validates a read-query, and returns a structured representation of it.