cargo sea-query 1.0.2

4 hours ago

Release Notes: sea-query 1.0.2

(since 1.0.1)

New Features

clear_group_by() and clear_having() on SelectStatement (#1086)

SelectStatement now has methods to clear a previously set GROUP BY or HAVING clause, which is useful when a query is being modified dynamically.

  • clear_group_by(): clears all group by expressions.
  • clear_having(): clears the having condition.
let query = Query::select()
    .from(Char::Table)
    .column(Char::Character)
    .add_group_by([Expr::col(Char::SizeW).into()])
    .clear_group_by()
    .to_owned();
// SELECT `character` FROM `character`

Fixes

sea_value_to_json_value no longer converts a null date/time value to the string "NULL" (#1097)

A None date/time Value was passed through value_to_string, which produced the literal string "NULL" and serialized it as Json::String("NULL") instead of Json::Null. Null date/time values now correctly convert to Json::Null, and non-null values are still rendered as their string representation. This affects with-chrono, with-time, and with-jiff date/time variants.

Compatibility Notes

This is a patch release of sea-query. It adds new SelectStatement methods and fixes JSON conversion of null date/time values; it does not intentionally change generated SQL for existing queries.

sea-query-derive remains on 1.0.0; no derive crate release is needed for this change.

Don't miss a new sea-query release

NewReleases is sending notifications on new releases.