Skip to main content

parse_generated_columns_from_table_sql

Function parse_generated_columns_from_table_sql 

Source
pub fn parse_generated_columns_from_table_sql(
    table: &str,
    sql: &str,
) -> HashMap<String, ParsedGenerated>
Available on crate feature std only.
Expand description

Parse generated columns from a CREATE TABLE SQL statement.

Returns a map keyed by "table:column" matching the key format used by process_columns.

This is intentionally a small, tolerant parser (not a full SQL parser). It handles common SQLite syntax for generated columns:

  • col TYPE GENERATED ALWAYS AS (expr) STORED
  • col TYPE GENERATED ALWAYS AS (expr) VIRTUAL