Skip to main content

try_parse_custom_statement

Function try_parse_custom_statement 

Source
pub fn try_parse_custom_statement(sql: &str) -> Result<Option<ParsedStatement>>
Expand description

Attempts to parse custom SQL extensions that sqlparser does not support.

Returns Ok(Some(..)) if the statement is a recognized extension, Ok(None) if it should be delegated to sqlparser, or Err on parse failure.

Supported extensions:

  • CREATE MASKING POLICY <name> STRATEGY <kind> [<arg>] EXEMPT ROLES (<r>, ...)
  • DROP MASKING POLICY <name>
  • ALTER TABLE <t> ALTER COLUMN <c> SET MASKING POLICY <name>
  • ALTER TABLE <t> ALTER COLUMN <c> DROP MASKING POLICY
  • CREATE MASK <name> ON <table>.<column> USING <strategy> (legacy v0.4.x)
  • DROP MASK <name> (legacy v0.4.x)
  • ALTER TABLE <t> MODIFY COLUMN <c> SET CLASSIFICATION '<class>'
  • SHOW CLASSIFICATIONS FOR <table> / SHOW TABLES / SHOW COLUMNS FROM <t>
  • CREATE USER <name> WITH ROLE <role>