Skip to main content

humanize_sql_for_show_create

Function humanize_sql_for_show_create 

Source
fn humanize_sql_for_show_create(
    catalog: &dyn SessionCatalog,
    id: CatalogItemId,
    sql: &str,
    redacted: bool,
) -> Result<String, PlanError>
Expand description

Convert a SQL statement into a form that could be used as input, as well as is more amenable to human consumption.

Note that the bits we omit here (e.g. the internal AS OF of a materialized view, or the DETAILS of a CREATE TABLE ... FROM SOURCE) are not user-typeable, but remain accessible for debugging in the raw create_sql (and redacted_create_sql) column of catalog builtins like mz_catalog.mz_materialized_views and mz_catalog.mz_tables. They are not in the definition column, which is parsed back out of create_sql and only retains the inner query.