1.8 KiB
1.8 KiB
Release Notes: sea-query 1.0.0-rc.31
(since 1.0.0-rc.30)
New Features
- Implement
SELECT INTOfor Postgres
let query = Query::select()
.from(Char::Table)
.column(Char::Character)
.into_table(SelectInto::table("character_copy").modifier(SelectIntoTableModifier::Unlogged))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character" INTO UNLOGGED TABLE "character_copy" FROM "character""#
);
let query = Query::select()
.from(Char::Table)
.column(Char::Character)
.into_table(SelectInto::table("character_temp").modifier(SelectIntoTableModifier::Temporary))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character" INTO TEMPORARY TABLE "character_temp" FROM "character""#
);
- Add
Expr::eq_anyandExpr::ne_all(Postgres, requirespostgres-arrayfeature)
let query = Query::select()
.columns([Char::Id])
.from(Char::Table)
.and_where(
(Char::Table, Char::SizeW)
.into_column_ref()
.eq_any([1, 2, 3]),
)
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "id" FROM "character" WHERE "character"."size_w" = ANY(ARRAY [1,2,3])"#
);
let query = Query::select()
.columns([Char::Id])
.from(Char::Table)
.and_where(
(Char::Table, Char::SizeW)
.into_column_ref()
.ne_all([1, 2, 3]),
)
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "id" FROM "character" WHERE "character"."size_w" <> ALL(ARRAY [1,2,3])"#
);
- Add
Value::array_type— returns theArrayTypeof aValuewithout inspecting the inner value
Bug Fixes
- Fix
GENERATED ALWAYSclause - Clarify default behaviour on
StringLen—StringLen::Nonemaps tovarchar(255)on MySQL,texton Postgres