impl

package
v1.0.0-beta-2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2023 License: MIT, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(systemTablePrefixes []string, opts ...parsing.Option) (parsing.SQLValidator, error)

New returns a Tableland query validator.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL