v0.4.0
Blog post: https://blog.lucasholten.com/rust-query-0-4/
Optional Queries
- Added
optional
combinator. - Changed
Expr
to be co-variant in its lifetime.
Basic Datatypes and Operations
- Added support for
Vec<u8>
data type (sqliteBLOB
). - Added some more basic operations on expressions.
Updates, Insert and Query
- Added safe updates of a subset of columns for each table.
- Update statements now use the
Update
type for each column. - Insert and update conflict is now an
Expr
(find_or_insert
returns anExpr
now too). Rows::into_vec
is no longer sorted automatically.
Schema and Mirations
- Changed
#[schema]
syntax to be a module of structs. - Added
#[from]
attribute to allow renaming tables and splitting tables in the schema. - The generated migration structs have moved from e.g.
v1::update::UserMigration
tov0::migrate::User
. - Migrations now require explicit handling of potential unique constraint violations.
- Migrations now require explicit handling of foreign key violations.
Type Driven Select
- Added a macro for each table to create ad-hoc column selection types like
User!(name, age)
. - Added the
FromExpr
trait to allow custom column selection and conversion.
Feature Flags and Dependencies
TransactionWeak::rusqlite_transaction
is renamed and no longer behind a feature flag.hash_schema
method was moved behinddev
feature which is enabled by default.- Updated dependencies.
Renaming
- Renamed
Dummy
toSelect
. - Renamed
Column
toExpr
. - Renamed
try_insert
toinsert
andinsert
toinsert_ok
. - Renamed
try_delete
todelete
anddelete
todelete_ok
. - Renamed
try_update
toupdate
andupdate
toupdate_ok
.