New Features
- New struct
FunctionCallwhich hold function and arguments #475 - New trait
IdenStaticwith methodfn as_str(&self) -> &'static str#508 - New traits
PgExprandSqliteExprfor custom expressions #519 - Support
BigDecimal,IpNetworkandMacAddressforsea-query-postgres#503
API Additions
- Added
SelectStatement::from_function#475 - Added binary operators from the Postgres
pg_trgmextension #486 - Added
ILIKEandNOT ILIKEoperators #473 - Added the
mulanddivmethods forSimpleExpr#510 - Added the
MATCH,->and->>operators for SQLite #513 - Added the
FULL OUTER JOIN#497 - Added
PgFunc::get_random_uuid#530 - Added
SimpleExpr::eq,SimpleExpr::ne,Expr::not_equals#528 - Added
PgFunc::starts_with#529 - Added
Expr::custom_keywordandSimpleExpr::not#535 - Added
SimpleExpr::like,SimpleExpr::not_likeandExpr::cast_as#539 - Added support for
NULLS NOT DISTINCTclause for Postgres #532 - Added
Expr::cust_with_exprandExpr::cust_with_exprs#531 - Added support for converting
&Stringto Value #537
Enhancements
- Made
value::with_arraymodule public and therefore makingNotU8trait public #511 - Drop the
Sizedrequirement on implementers ofSchemaBuilders#524
Bug fixes
// given
let (statement, values) = sea_query::Query::select()
.column(Glyph::Id)
.from(Glyph::Table)
.cond_where(Cond::any()
.add(Cond::all()) // empty all() => TRUE
.add(Cond::any()) // empty any() => FALSE
)
.build(sea_query::MysqlQueryBuilder);
// old behavior
assert_eq!(statement, r#"SELECT `id` FROM `glyph`"#);
// new behavior
assert_eq!(
statement,
r#"SELECT `id` FROM `glyph` WHERE (TRUE) OR (FALSE)"#
);Breaking changes
- MSRV is up to 1.62 #535
ColumnType::Arraydefinition changed fromArray(SeaRc<Box<ColumnType>>)toArray(SeaRc<ColumnType>)#492Func::*now returnsFunctionCallinstead ofSimpleExpr#475Func::coalescenow acceptsIntoIterator<Item = SimpleExpr>instead ofIntoIterator<Item = Into<SimpleExpr>#475- Removed
Expr::argandExpr::args- these functions are no longer needed #475 - Moved all Postgres specific operators to
PgBinOper#507 Expr::value,Expr::gt,Expr::gte,Expr::lt,Expr::lte,Expr::add,Expr::div,Expr::sub,Expr::modulo,Expr::left_shift,Expr::right_shift,Expr::between,Expr::not_between,Expr::is,Expr::is_not,Expr::if_nullnow acceptsInto<SimpleExpr>instead ofInto<Value>#476Expr::is_in,Expr::is_not_innow acceptsInto<SimpleExpr>instead ofInto<Value>and convert it toSimpleExpr::Tupleinstead ofSimpleExpr::Values#476Expr::exprnow acceptsInto<SimpleExpr>instead ofSimpleExpr#475- Moved
Expr::ilike,Expr::not_ilike,Expr::matches,Expr::contains,Expr::contained,Expr::concatenate,Expr::concat,SimpleExpr::concatenateandSimpleExpr::concatto new traitPgExpr#519 Expr::equalsnow acceptsC: IntoColumnRefinstead ofT: IntoIden, C: IntoIden#528- Removed integer and date time column types' display length / precision option #525
Deprecations
- Deprecated
Expr::greater_than,Expr::greater_or_equal,Expr::less_thanandExpr::less_or_equal#476 - Deprecated
SimpleExpr::equals,SimpleExpr::not_equals#528 - Deprecated
Expr::tbl, please useExpr::colwith a tuple #540
House keeping
- Replace
impl Defaultwith#[derive(Default)]#535 - Exclude
sqlxdefault features #543 - Use
dtolnay/rust-toolchaininstead ofactions-rs/toolchaininCI#544
Full Changelog: 0.27.0...0.28.0