Documentation
¶
Overview ¶
Package tidbparser extracts parser-neutral statements from TiDB AST nodes. input: TiDB parser statement nodes and parser-neutral dialect metadata output: extractor-backed parsed statements for the application layer, including MutationTargets and mutation-target-only DML tables, normalized ALTER index/constraint actions, and primary-key metadata pos: infrastructure extraction adapter between TiDB AST and domain spec note: if this file changes, update this header and module README.md.
Package tidbparser loads SQL text through the TiDB parser. input: SQL text and TiDB parser runtime dependencies output: raw parsed statement nodes and parser warnings for application orchestration pos: infrastructure parser adapter for MySQL and TiDB SQL parsing note: if this file changes, update this header and module README.md.
Package tidbparser extracts query access facts from TiDB AST nodes. input: SQL text, dialect, and default schema through the TiDB parser output: parser-neutral QueryAccessFacts for relation, column, output, and read-classification analysis pos: infrastructure query access adapter between TiDB AST and application query access contracts note: if this file changes, update this header and module README.md.
Package tidbparser defines bounded internal effect-candidate facts. input: TiDB AST function-like nodes and resolved parser scope output: ordered, untrusted candidate facts for application-internal gateways pos: parser candidate contract; never a public result contract
Index ¶
- type AlterDatabaseStatement
- type AlterPlacementPolicyStatement
- type AlterSequenceStatement
- type AlterTableStatement
- type AlterUserStatement
- type ColumnFact
- type CreateIndexStatement
- type CreatePlacementPolicyStatement
- type CreateSequenceStatement
- type CreateTableStatement
- type CreateUserStatement
- type CreateViewStatement
- type DeleteStatement
- type DropIndexStatement
- type DropPlacementPolicyStatement
- type DropProcedureStatement
- type DropResourceGroupStatement
- type DropSequenceStatement
- type DropTableStatement
- type DropUserStatement
- type EffectCandidate
- type EffectCandidateKind
- type ExtractedStatement
- type GrantStatement
- type InsertStatement
- type OperandColumnRef
- type OperandKindHint
- type OutputFact
- type Parser
- type ProcedureInfoStatement
- type QueryAccessExtractor
- type QueryAccessFacts
- type RelationFact
- type RenameTableStatement
- type Result
- type RevokeStatement
- type StatementNode
- type TruncateTableStatement
- type UnresolvedFact
- type UpdateStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterDatabaseStatement ¶ added in v0.200.0
type AlterDatabaseStatement = *ast.AlterDatabaseStmt
type AlterPlacementPolicyStatement ¶ added in v0.200.0
type AlterPlacementPolicyStatement = *ast.AlterPlacementPolicyStmt
type AlterSequenceStatement ¶ added in v0.200.0
type AlterSequenceStatement = *ast.AlterSequenceStmt
type AlterTableStatement ¶ added in v0.15.0
type AlterTableStatement = *ast.AlterTableStmt
type AlterUserStatement ¶ added in v0.200.0
type AlterUserStatement = *ast.AlterUserStmt
type ColumnFact ¶ added in v0.380.0
type CreateIndexStatement ¶ added in v0.15.0
type CreateIndexStatement = *ast.CreateIndexStmt
type CreatePlacementPolicyStatement ¶ added in v0.200.0
type CreatePlacementPolicyStatement = *ast.CreatePlacementPolicyStmt
type CreateSequenceStatement ¶ added in v0.200.0
type CreateSequenceStatement = *ast.CreateSequenceStmt
type CreateTableStatement ¶ added in v0.15.0
type CreateTableStatement = *ast.CreateTableStmt
type CreateUserStatement ¶ added in v0.200.0
type CreateUserStatement = *ast.CreateUserStmt
type CreateViewStatement ¶ added in v0.15.0
type CreateViewStatement = *ast.CreateViewStmt
type DeleteStatement ¶ added in v0.15.0
type DeleteStatement = *ast.DeleteStmt
type DropIndexStatement ¶ added in v0.15.0
type DropIndexStatement = *ast.DropIndexStmt
type DropPlacementPolicyStatement ¶ added in v0.200.0
type DropPlacementPolicyStatement = *ast.DropPlacementPolicyStmt
type DropProcedureStatement ¶ added in v0.200.0
type DropProcedureStatement = *ast.DropProcedureStmt
type DropResourceGroupStatement ¶ added in v0.200.0
type DropResourceGroupStatement = *ast.DropResourceGroupStmt
type DropSequenceStatement ¶ added in v0.200.0
type DropSequenceStatement = *ast.DropSequenceStmt
type DropTableStatement ¶ added in v0.15.0
type DropTableStatement = *ast.DropTableStmt
type DropUserStatement ¶ added in v0.200.0
type DropUserStatement = *ast.DropUserStmt
type EffectCandidate ¶ added in v0.410.0
type EffectCandidate struct {
Kind EffectCandidateKind
Ordinal int
NamePath []string
OriginalNamePath []string
ExplicitSchema bool
IsQuoted bool
Canonical bool
Ambiguous bool
ParserClassification string
UnqualifiedRelation bool
Arity int
OperandKinds []OperandKindHint
OperandColumnRefs []OperandColumnRef
IsAggregate bool
HasWindow bool
HasFilter bool
HasDistinct bool
HasAggOrder bool
HasWithinGroup bool
HasFrame bool
HasNamedWindow bool
HasWindowPartition bool
HasWindowOrder bool
WindowPartitionKinds []OperandKindHint
WindowOrderKinds []OperandKindHint
WindowFrameKinds []OperandKindHint
WindowPartitionColumnRefs []OperandColumnRef
WindowOrderColumnRefs []OperandColumnRef
TargetTypePath []string
}
type EffectCandidateKind ¶ added in v0.410.0
type EffectCandidateKind string
const ( EffectCandidateOperator EffectCandidateKind = "operator" EffectCandidateFunction EffectCandidateKind = "function" EffectCandidateCast EffectCandidateKind = "cast" EffectCandidateUnknown EffectCandidateKind = "unknown" )
type ExtractedStatement ¶ added in v0.15.0
type ExtractedStatement struct {
Kind spec.Kind
RawSQL string
Extractor spec.StatementExtractor
}
ExtractedStatement is the adapter-owned parser result used by the application layer.
func WrapStatements ¶ added in v0.15.0
func WrapStatements(stmts []ast.StmtNode, warnings []string) []ExtractedStatement
type GrantStatement ¶ added in v0.200.0
type InsertStatement ¶ added in v0.15.0
type InsertStatement = *ast.InsertStmt
type OperandColumnRef ¶ added in v0.410.0
type OperandKindHint ¶ added in v0.410.0
type OperandKindHint string
const ( OperandKindColumn OperandKindHint = "column" OperandKindConst OperandKindHint = "const" OperandKindParam OperandKindHint = "param" OperandKindStar OperandKindHint = "star" OperandKindExpr OperandKindHint = "expr" OperandKindSubquery OperandKindHint = "subquery" OperandKindUnknown OperandKindHint = "unknown" )
type OutputFact ¶ added in v0.380.0
type ProcedureInfoStatement ¶ added in v0.200.0
type ProcedureInfoStatement = *ast.ProcedureInfo
type QueryAccessExtractor ¶ added in v0.380.0
type QueryAccessExtractor struct{}
func (*QueryAccessExtractor) ExtractQueryAccess ¶ added in v0.380.0
func (e *QueryAccessExtractor) ExtractQueryAccess(ctx context.Context, sql string, dialect string, defaultSchema string) (*QueryAccessFacts, error)
type QueryAccessFacts ¶ added in v0.380.0
type QueryAccessFacts struct {
ReadClassification string `json:"read_classification"`
Relations []RelationFact `json:"relations,omitempty"`
ColumnReferences []ColumnFact `json:"column_references,omitempty"`
Outputs []OutputFact `json:"outputs,omitempty"`
Unresolved []UnresolvedFact `json:"unresolved,omitempty"`
ReasonCodes []string `json:"reason_codes,omitempty"`
EffectCandidates []EffectCandidate `json:"-"`
}
type RelationFact ¶ added in v0.380.0
type RenameTableStatement ¶ added in v0.15.0
type RenameTableStatement = *ast.RenameTableStmt
type RevokeStatement ¶ added in v0.200.0
type RevokeStatement = *ast.RevokeStmt
type StatementNode ¶ added in v0.15.0
type TruncateTableStatement ¶ added in v0.15.0
type TruncateTableStatement = *ast.TruncateTableStmt
type UnresolvedFact ¶ added in v0.380.0
type UpdateStatement ¶ added in v0.15.0
type UpdateStatement = *ast.UpdateStmt