0.28.0
New Features
- New struct
FunctionCall
which hold function and arguments #475 - New trait
IdenStatic
with methodfn as_str(&self) -> &'static str
#508 - New traits
PgExpr
andSqliteExpr
for custom expressions #519 - Support
BigDecimal
,IpNetwork
andMacAddress
forsea-query-postgres
#503
API Additions
- Added
SelectStatement::from_function
#475 - Added binary operators from the Postgres
pg_trgm
extension #486 - Added
ILIKE
andNOT ILIKE
operators #473 - Added the
mul
anddiv
methods 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_keyword
andSimpleExpr::not
#535 - Added
SimpleExpr::like
,SimpleExpr::not_like
andExpr::cast_as
#539 - Added support for
NULLS NOT DISTINCT
clause for Postgres #532 - Added
Expr::cust_with_expr
andExpr::cust_with_exprs
#531 - Added support for converting
&String
to Value #537
Enhancements
- Made
value::with_array
module public and therefore makingNotU8
trait public #511 - Drop the
Sized
requirement 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::Array
definition changed fromArray(SeaRc<Box<ColumnType>>)
toArray(SeaRc<ColumnType>)
#492Func::*
now returnsFunctionCall
instead ofSimpleExpr
#475Func::coalesce
now acceptsIntoIterator<Item = SimpleExpr>
instead ofIntoIterator<Item = Into<SimpleExpr>
#475- Removed
Expr::arg
andExpr::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_null
now acceptsInto<SimpleExpr>
instead ofInto<Value>
#476Expr::is_in
,Expr::is_not_in
now acceptsInto<SimpleExpr>
instead ofInto<Value>
and convert it toSimpleExpr::Tuple
instead ofSimpleExpr::Values
#476Expr::expr
now acceptsInto<SimpleExpr>
instead ofSimpleExpr
#475- Moved
Expr::ilike
,Expr::not_ilike
,Expr::matches
,Expr::contains
,Expr::contained
,Expr::concatenate
,Expr::concat
,SimpleExpr::concatenate
andSimpleExpr::concat
to new traitPgExpr
#519 Expr::equals
now acceptsC: IntoColumnRef
instead 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_than
andExpr::less_or_equal
#476 - Deprecated
SimpleExpr::equals
,SimpleExpr::not_equals
#528 - Deprecated
Expr::tbl
, please useExpr::col
with a tuple #540
House keeping
- Replace
impl Default
with#[derive(Default)]
#535 - Exclude
sqlx
default features #543 - Use
dtolnay/rust-toolchain
instead ofactions-rs/toolchain
inCI
#544
Full Changelog: 0.27.0...0.28.0