Releases: SeaQL/sea-query
Releases · SeaQL/sea-query
0.26.3
0.26.2
0.26.0
New Features
- Add support for
VALUES
lists (#351) - Introduce
sea-query-binder
(#275) - Convert from
IpNetwork
andMacAddress
toValue
(#364)
Enhancements
- Move
escape
andunescape
string to backend (#306) LIKE ESCAPE
support (#352, #353)clear_order_by
forOrderedStatement
- Add method to make a column nullable (#365)
- Add
is
&is_not
to Expr (#348) - Add
CURRENT_TIMESTAMP
function (#349) - Add
in_tuples
method to Expr (#345)
Upgrades
- Upgrade
uuid
to 1.0 - Upgrade
time
to 0.3 - Upgrade
ipnetwork
to 0.19 - Upgrade
bigdecimal
to 0.3 - Upgrade
sqlx
driver to 0.6
Breaking changes
- As part of #306, the standalone functions
escape_string
andunescape_string
are removed, and becomes backend specific. So now, you have to:
use sea_query::EscapeBuilder;
let string: String = MySqlQueryBuilder.escape_string(r#" "abc" "#);
let string: String = MysqlQueryBuilder.unescape_string(r#" \"abc\" "#);
-
Replace
Value::Ipv4Network
andValue::Ipv6Network
toValue::IpNetwork
(#364) -
Remove some redundant feature flags
postgres-chrono
,postgres-json
,postgres-uuid
,postgres-time
. Use thewith-*
equivalence
0.25.2
0.25.1
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
Iden
enum from struct #300 - Add ability to alter foreign keys #299
- Select
DISTINCT ON
#313
Enhancements
- Insert Default #266
- Make
sea-query-driver
an optional dependency #324 - Add
ABS
function #334 - Support
IF NOT EXISTS
when create index #332 - Support different
blob
types in MySQL #314 - Add
VarBinary
column type #331 - Returning expression supporting
SimpleExpr
#335
Bug fixes
Breaking Changes
- Introducing a dedicated
ReturningClause
instead of reusingSelect
onreturning
: #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