0.25.0
New Features
- CASE WHEN statement support #304
- Add support for Ip(4,6)Network and MacAddress #309
- [sea-query-attr] macro for deriving
Idenenum from struct #300 - Add ability to alter foreign keys #299
- Select
DISTINCT ON#313
Enhancements
- Insert Default #266
- Make
sea-query-driveran optional dependency #324 - Add
ABSfunction #334 - Support
IF NOT EXISTSwhen create index #332 - Support different
blobtypes in MySQL #314 - Add
VarBinarycolumn type #331 - Returning expression supporting
SimpleExpr#335
Bug fixes
Breaking Changes
- Introducing a dedicated
ReturningClauseinstead of reusingSelectonreturning: #317
.returning(Query::select().column(Glyph::Id).take()) // before
.returning(Query::returning().columns([Glyph::Id])) // now- In #333, the custom expression API changed for Postgres, users should change their placeholder from
?to Postgres's$N
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::col(Char::Id).eq(1))
.and_where(Expr::cust_with_values("6 = $2 * $1", vec![3, 2]).into())
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "id" = 1 AND 6 = 2 * 3"#
);As a side effect, ?? is no longer needed for escaping ?
let query = Query::select()
.expr(Expr::cust_with_values(
"data @? ($1::JSONPATH)",
vec!["hello"],
))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT data @? ('hello'::JSONPATH)"#
);- In #314,
ColumnType'sBinary(Option<u32>)changed toBinary(BlobSize), so if you usedBinary(None)before, you should change toBinary(BlobSize::Blob(None))
New Contributors
- @SebastienGllmt made their first contribution in #307
- @hunjixin made their first contribution in #308
- @eexsty made their first contribution in #300
- @karatakis made their first contribution in #299
- @marti4d made their first contribution in #324
- @liberwang1013 made their first contribution in #332
- @samtay made their first contribution in #337
Full Changelog: 0.24.0...0.25.0