Documentation
¶
Overview ¶
Package sqlparser provides helpers and caching for pg_query_go PostgreSQL AST parsing.
Index ¶
- func CollectCreatedTables(tree *pg_query.ParseResult) map[string]bool
- func ExtractFromTableNames(stmt *pg_query.SelectStmt) []string
- func ExtractLockingInfo(stmt *pg_query.SelectStmt) (hasLocking bool, isForUpdate bool, isSkipLocked bool, isNoWait bool)
- func HasSelectStar(stmt *pg_query.SelectStmt) bool
- func Parse(query string) (*pg_query.ParseResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectCreatedTables ¶
func CollectCreatedTables(tree *pg_query.ParseResult) map[string]bool
CollectCreatedTables extracts table names (in lowercase) defined via CREATE TABLE in an AST parse tree.
func ExtractFromTableNames ¶
func ExtractFromTableNames(stmt *pg_query.SelectStmt) []string
ExtractFromTableNames extracts all table names referenced in a SelectStmt's FromClause.
func ExtractLockingInfo ¶
func ExtractLockingInfo(stmt *pg_query.SelectStmt) (hasLocking bool, isForUpdate bool, isSkipLocked bool, isNoWait bool)
ExtractLockingInfo inspects a SelectStmt's LockingClause. Returns hasLocking, isForUpdate, isSkipLocked, isNoWait.
func HasSelectStar ¶
func HasSelectStar(stmt *pg_query.SelectStmt) bool
HasSelectStar checks if a SelectStmt projects a wildcard (*) or alias.*. Ignores aggregate functions like COUNT(*).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.