Documentation
¶
Overview ¶
Package stmtclass provides lightweight runtime SQL statement classification used to decide transactional vs non-transactional execution and idempotency hints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyTokens ¶
func ClassifyTokens(d Dialect, majorVersion int, ts sqltoken.Tokens) (stmts []StatementFlags, aggregate Flag)
ClassifyTokens classifies a tokenized script. For Postgres, majorVersion supplies version gating (pass 0 if unknown). Returns per-statement flags and aggregate mask.
Types ¶
type StatementFlags ¶
StatementFlags associates a statement's original text with its flags.
type Summary ¶
Summary maps each flag to the first statement text that exhibited it. Flags that are synthetic (e.g. IsMultipleStatements) will map to "" unless explicitly derived from a concrete statement.
func Summarize ¶
func Summarize(stmts []StatementFlags, aggregate Flag) Summary
Summarize builds a Summary. For each flag it records the first statement whose Flags include it.