UtilityOption in sqlparser::ast - Rust

Struct UtilityOption 

Source

pub struct UtilityOption {
    pub name: Ident,
    pub arg: Option<Expr>,
}
Expand description

Represents a single PostgreSQL utility option.

A utility option is a key-value pair where the key is an identifier (IDENT) and the value can be one of the following:

  • A number with an optional sign (+ or -). Example: +10, -10.2, 3
  • A non-keyword string. Example: option1, 'option2', "option3"
  • keyword: TRUE, FALSE, ON (off is also accept).
  • Empty. Example: ANALYZE (identifier only)

Utility options are used in various PostgreSQL DDL statements, including statements such as CLUSTER, EXPLAIN, VACUUM, and REINDEX. These statements format options as ( option [, ...] ).

CLUSTER EXPLAIN VACUUM REINDEX

For example, the EXPLAIN AND VACUUM statements with options might look like this:

EXPLAIN (ANALYZE, VERBOSE TRUE, FORMAT TEXT) SELECT * FROM my_table;

VACUUM (VERBOSE, ANALYZE ON, PARALLEL 10) my_table;

The option name (identifier).

Optional argument for the option (number, string, keyword, etc.).

§
§
§
§
§
§