Documentation
¶
Overview ¶
Package sqlprotect checks a statement a transform's covered caller sends against the columns the transform protects (#2634): a protected column may be selected as it is, and used nowhere else. An expression, a function argument, a filter, a join condition, a grouping, an ordering (by name or by position), a window, DISTINCT, a set operation other than UNION ALL, a rename, a column list on an alias, and a write all let a caller learn or copy the value the transform hides, so each is refused naming the column and the handler. A statement the parser cannot read is refused when it names a protected column at all.
Names are followed through aliases, derived tables and CTEs by name: a column named like a protected one, anywhere a protected table is in scope, is treated as the protected column, which refuses a statement that merely shares the name rather than ever admitting one that hides it. A view is followed through its definition, which ViewReader supplies.
The grammar is PostgreSQL's (github.com/multigres/multigres), which reads the statements a Trino connection and an application database are sent alike; Trino's own extensions it cannot read (try_cast, table functions) are refused for a covered caller only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RefusalError ¶
RefusalError is a statement refused for a protected column.
func (*RefusalError) Error ¶
func (e *RefusalError) Error() string