Releases: LHolten/rust-query
Releases · LHolten/rust-query
v0.4.3
v0.4.2
- Update the
Rows::join
method to take a constant argument.
This is now the prefered join syntax and all examples have been updated. - Allow arbitrary correlated subqueries.
This means thatAggregate
now has an implied bound that allows leakingExpr
from the
out scope. Correlated subqueries are decorrelated before translating to SQL. - Fix loose lifetime on
Optional
.
v0.4.1
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
.
v0.3.1
- Added error message when defining an
id
column. - Added support for sqlite
LIKE
andGLOB
operators. - Added support for
DELETE
usingTransactionWeak
and#[no_reference]
. - Added
TransactionWeak::unchecked_transaction
behind feature flag. - Added
impl ToSql for TableRow
behindunchecked_transaction
feature flag. - Removed
impl RefCast for Transaction
, it was not intended to be public. - Removed
impl FromSql for TableRow
, it was not intended to be public.
v0.3.0
- Added support for updating rows.
- Added
Table::dummy
method, which makes it easier to do partial updates. - Reused table types in the generated API for both naming
TableRow<User>
and dummiesUser {name: "steve"}
. - Forbid
Option
in unique constraints. - Renamed
ThreadToken
toLocalClient
. - Renamed and moved
read
andwrite_lock
totransaction
andtransaction_mut
. - Check
schema_version
at the start of every transaction. - Simplify migration and borrow
LocalClient
only once. - Renamed
Prepare
toConfig
and simplified its API.
v0.2.2
- Bound the lifetime of
TableRow: IntoColumn
to the lifetime of the transaction.
Without the bound it was possible to sneakTableRow
s into following transacions.
query_one
now checks that its input lives for as long as the transaction.
To make sure thatquery_one
still checks that the dummy is "global", the transaction now has an invariant lifetime.
v0.2.1
- Relax
Transaction
creation to not borrow theDatabase
. - Add missing lifetime bound on
try_insert
s return value.
Technically this is a breaking change, but it fixes a bug so it is still a patch release. - Fix the version of the macro crate exactly (=0.2.0) to allow future internal API changes with only a patch release.
v0.2.0
- Rewrote almost the whole library to specify the schema using enum syntax with a proc macro.
- Added a single Column type to handle a lot of query building.
- Dummy trait to retrieve multiple values at once and allow post processing.
- Added support for transactions and multiple schemas.