parser

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParserNotInitialized = fmt.Errorf("parser not initialized")
)

Functions

This section is empty.

Types

type AST added in v0.4.0

type AST *internal.AST

type ASTResult added in v0.3.0

type ASTResult *internal.ASTResult

type ASTs added in v0.4.0

type ASTs *internal.ASTs

type Database added in v0.3.0

type Database string
const (
	Athena      Database = "athena"
	BigQuery    Database = "bigquery"
	DB2         Database = "db2"
	FlinkSQL    Database = "flinksql"
	Hive        Database = "hive"
	MariaDB     Database = "mariadb"
	MySQL       Database = "mysql"
	Noql        Database = "noql"
	PostgreSQL  Database = "postgresql"
	Redshift    Database = "redshift"
	Snowflake   Database = "snowflake"
	Sqlite      Database = "sqlite"
	TransactSQL Database = "transactsql"
	Trino       Database = "trino"
)

func (Database) String added in v0.3.0

func (d Database) String() string

type Option added in v0.3.0

type Option interface {
	Opt(types.Option)
}

func WithDatabase added in v0.3.0

func WithDatabase(db Database) Option

type ParseResult added in v0.3.0

type ParseResult *internal.ParseResult

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func New

func New() (*Parser, error)

func (*Parser) Astify

func (p *Parser) Astify(sql string, opts ...Option) (ASTResult, error)

func (*Parser) ColumnList

func (p *Parser) ColumnList(sql string, opts ...Option) ([]string, error)

func (*Parser) Parse

func (p *Parser) Parse(sql string, opts ...Option) (ParseResult, error)

func (*Parser) Sqlify

func (p *Parser) Sqlify(ast ASTResult, opts ...Option) (string, error)

func (*Parser) TableList

func (p *Parser) TableList(sql string, opts ...Option) ([]string, error)

func (*Parser) WhiteListCheck

func (p *Parser) WhiteListCheck(sql string, whiteList []string, opts ...Option) error

type TableColumnList added in v0.3.0

type TableColumnList *internal.TableColumnList

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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