Documentation
¶
Index ¶
- Variables
- type AST
- func (a AST) Alter() (*types.Alter, error)
- func (a AST) Create() (*types.Create, error)
- func (a AST) Delete() (*types.Delete, error)
- func (a AST) Drop() (*types.Drop, error)
- func (a AST) Insert() (*types.Insert, error)
- func (a AST) Is(s types.Statement) bool
- func (a AST) Select() (*types.Select, error)
- func (a AST) Type() types.Statement
- func (a AST) Update() (*types.Update, error)
- func (a AST) Use() (*types.Use, error)
- type ASTs
- type Database
- type Option
- type ParseResult
- type Parser
- func (p *Parser) Astify(sql string, opts ...Option) (ASTs, error)
- func (p *Parser) ColumnList(sql string, opts ...Option) ([]string, error)
- func (p *Parser) Parse(sql string, opts ...Option) (*ParseResult, error)
- func (p *Parser) Sqlify(ast *AST, opts ...Option) (string, error)
- func (p *Parser) TableList(sql string, opts ...Option) ([]string, error)
- func (p *Parser) WhiteListCheck(sql string, whiteList []string, opts ...Option) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Databases = []Database{ Athena, BigQuery, DB2, FlinkSQL, Hive, MariaDB, MySQL, Noql, PostgreSQL, Redshift, Snowflake, Sqlite, TransactSQL, Trino, }
View Source
var (
ErrParserNotInitialized = fmt.Errorf("parser not initialized")
)
Functions ¶
This section is empty.
Types ¶
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" )
type Option ¶ added in v0.3.0
func WithDatabase ¶ added in v0.3.0
func WithStatementPath ¶ added in v0.9.0
type ParseResult ¶ added in v0.3.0
type ParseResult struct { AST ASTs internal.TableColumnList }
func NewParseResult ¶ added in v0.5.0
func NewParseResult(val *internal.ParseResult) *ParseResult
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ColumnList ¶
Click to show internal directories.
Click to hide internal directories.