Skip to content

0.32.2

Latest
Compare
Choose a tag to compare
@tyt2y3 tyt2y3 released this 18 Feb 00:33

New Features

  • Added with_cte to use WITH clauses in all statements #859
let select = SelectStatement::new()
    .columns([Glyph::Id, Glyph::Image, Glyph::Aspect])
    .from(Glyph::Table)
    .to_owned();
let cte = CommonTableExpression::new()
    .query(select)
    .table_name(Alias::new("cte"))
    .to_owned();
let select = SelectStatement::new()
    .columns([Glyph::Id, Glyph::Image, Glyph::Aspect])
    .from(Alias::new("cte"))
    .with_cte(cte)
    .to_owned();
assert_eq!(
    select.to_string(PostgresQueryBuilder),
    [
        r#"WITH "cte" AS"#,
        r#"(SELECT "id", "image", "aspect""#,
        r#"FROM "glyph")"#,
        r#"SELECT "id", "image", "aspect" FROM "cte""#,
    ]
    .join(" ")
);

Enhancements

  • Added Expr::column #852
  • Added Postgres function DATE_TRUNC #825
  • Added INCLUDE clause for Postgres BTree index #826

Bug Fixes

  • Write empty Postgres array as '{}' #854