Summary
isAllowedPostgresSelectQuery blocks any script containing insert , update , delete , drop , … — false positives on inserted_at, dropped_at. It allows anything starting with select / with / ( including a second statement if the driver ever uses simple protocol. Leading ( is enough to pass.
Scope
- Classify by the first statement after comments (reuse stripLeadingWhitespaceAndLineComments), not contains.
- Allow SELECT / WITH / TABLE / VALUES / (SELECT …) only; reject multi-statement.
- Tests: SELECT inserted_at FROM t allowed; SELECT 1; DELETE FROM t rejected.
Out of scope
- Full SQL editor (already has DestructiveSqlDetector). This is the Table Browser SQL dialog only.
Reactions are currently unavailable
Summary
isAllowedPostgresSelectQuery blocks any script containing insert , update , delete , drop , … — false positives on inserted_at, dropped_at. It allows anything starting with select / with / ( including a second statement if the driver ever uses simple protocol. Leading ( is enough to pass.
Scope
Out of scope