ISSUE-1147: Add support for MATERIALIZED CTEs (#1148)

Co-authored-by: Andrew Repp <arepp@cloudflare.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
Andrew Repp 2024-02-29 06:54:36 -06:00 committed by GitHub
parent 57113a9344
commit 0c5f6fbf81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 65 additions and 9 deletions

View file

@ -3837,3 +3837,12 @@ fn parse_array_agg() {
let sql4 = "SELECT ARRAY_AGG(my_schema.sections_tbl.*) AS sections FROM sections_tbl";
pg().verified_stmt(sql4);
}
#[test]
fn parse_mat_cte() {
let sql = r#"WITH cte AS MATERIALIZED (SELECT id FROM accounts) SELECT id FROM cte"#;
pg().verified_stmt(sql);
let sql2 = r#"WITH cte AS NOT MATERIALIZED (SELECT id FROM accounts) SELECT id FROM cte"#;
pg().verified_stmt(sql2);
}