Documentation
¶
Overview ¶
Package sqlclass classifies SQL strings into a leading verb and a best-effort primary table name. It is deliberately small: a hand-rolled scanner, no dependency on a full SQL parser. Output drives the Op.Name field used by the adapter/sql and adapter/pgx chaos adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classification ¶
Classification carries the verb and table extracted from a SQL string. Both fields are uppercased ASCII for the verb and case-preserved for the table identifier (with surrounding quotes/brackets stripped and a schema prefix removed).
func Classify ¶
func Classify(sql string) Classification
Classify returns a Classification for sql. Unrecognized input yields the leading token as Verb (uppercased) and an empty Table. Empty input yields the zero Classification.