New Features
- Support
CROSS JOIN#376 - We are going through series of changes to how database drivers work
(#416, #423):sea-query-binderis now the recommended way (trait based) of working with SQLx, replacingsea-query-driver(macro based) #434sea-query-binderis now a separate dependency, instead of integrated withsea-query#432rusqlitesupport is moved tosea-query-rusqlite#422postgressupport is moved tosea-query-postgres#433
- Added sub-query operators:
EXISTS,ALL,ANY,SOME#379 - Added support to
ON CONFLICT WHERE#447 - Added support
DROP COLUMNfor SQLite #455 - Added
YEAR,BITandVARBITtypes #466 - Added support one dimension Postgres array for SQLx #467
Enhancements
- Handle Postgres schema name for schema statements #385
- Added
%,<<and>>binary operators #419 - Added
RANDfunction #430 - Implements
DisplayforValue#425 - Added
INTERSECTandEXCEPTtoUnionType#438 - Added
OnConflict::valueandOnConflict::values#451 ColumnDef::defaultnow accepts bothValueandSimpleExpr#436OrderedStatement::order_by_customs,OrderedStatement::order_by_columns,OverStatement::partition_by_customs,OverStatement::partition_by_columnsnow acceptsIntoIterator<Item = T>instead ofVec<T>#448Expr::case,CaseStatement::caseandCaseStatement::finallynow acceptsInto<SimpleExpr>instead ofInto<Expr>#460UpdateStatement::valuenow acceptInto<SimpleExpr>instead ofInto<Value>#460TableAlterStatement::rename_column,TableAlterStatement::drop_column,ColumnDef::new,ColumnDef::new_with_typenow acceptsIntoIdeninstead ofIden#472
Bug Fixes
distinct_onproperly handlesColumnRef#450- Removed
ONforDROP INDEXfor SQLite #462 - Change datetime string format to include microseconds #468
ALTER TABLEfor PosgreSQL withUNIQUEconstraint #472
Breaking changes
- Changed
in_tuplesinterface to acceptIntoValueTuple#386 - Removed deprecated methods (
or_where,or_having,table_columnetc) #380 - Changed
cond_wherechaining semantics #417
// Before: will extend current Condition
assert_eq!(
Query::select()
.cond_where(any![Expr::col(Glyph::Id).eq(1), Expr::col(Glyph::Id).eq(2)])
.cond_where(Expr::col(Glyph::Id).eq(3))
.to_owned()
.to_string(PostgresQueryBuilder),
r#"SELECT WHERE "id" = 1 OR "id" = 2 OR "id" = 3"#
);
// Before: confusing, since it depends on the order of invocation:
assert_eq!(
Query::select()
.cond_where(Expr::col(Glyph::Id).eq(3))
.cond_where(any![Expr::col(Glyph::Id).eq(1), Expr::col(Glyph::Id).eq(2)])
.to_owned()
.to_string(PostgresQueryBuilder),
r#"SELECT WHERE "id" = 3 AND ("id" = 1 OR "id" = 2)"#
);
// Now: will always conjoin with `AND`
assert_eq!(
Query::select()
.cond_where(Expr::col(Glyph::Id).eq(1))
.cond_where(any![Expr::col(Glyph::Id).eq(2), Expr::col(Glyph::Id).eq(3)])
.to_owned()
.to_string(PostgresQueryBuilder),
r#"SELECT WHERE "id" = 1 AND ("id" = 2 OR "id" = 3)"#
);
// Now: so they are now equivalent
assert_eq!(
Query::select()
.cond_where(any![Expr::col(Glyph::Id).eq(2), Expr::col(Glyph::Id).eq(3)])
.cond_where(Expr::col(Glyph::Id).eq(1))
.to_owned()
.to_string(PostgresQueryBuilder),
r#"SELECT WHERE ("id" = 2 OR "id" = 3) AND "id" = 1"#
);CURRENT_TIMESTAMPchanged from being a function to keyword #441- Update SQLite
booleantype fromintegertoboolean#400 - Changed type of
ColumnType::Enumfrom(String, Vec<String>)to: #435
Enum {
name: DynIden,
variants: Vec<DynIden>,
}- Deprecated
InsertStatement::exprs,InsertStatement::exprs_panic,OnConflict::update_value,OnConflict::update_values,OnConflict::update_expr,OnConflict::update_exprs,UpdateStatement::col_expr,UpdateStatement::value_expr,UpdateStatement::exprs#460 InsertStatement::values,UpdateStatement::valuesnow acceptsIntoIterator<Item = SimpleExpr>instead ofIntoIterator<Item = Value>#460- Use native api from SQLx for SQLite to work with
time#412
House keeping
- Cleanup
IndexBuildertrait methods #426 - Introduce
SqlWritertrait #436 - Remove unneeded
vec!from examples #448
Upgrades
- Upgrade
sqlxdriver to 0.6.1
Contributors
- @ikrivosheev was the big contributor in this release
- @nahuakang made their first contribution in #385
- @robjtede made their first contribution in #410
- @tooboredtocode made their first contribution in #419
- @alper made their first contribution in #430
- @Martichou made their first contribution in #438
- @EstebanBorai made their first contribution in #443
- @anshulxyz made their first contribution in #400
- @ryanahall made their first contribution in #384
- @Cobular made their first contribution in #450
- @pweglik made their first contribution in #455
- @baszalmstra made their first contribution in #462
- @kyoto7250 made their first contribution in #412
Full Changelog: 0.26.0...0.27.0