Skip to content

v0.4.0

Compare
Choose a tag to compare
@LHolten LHolten released this 13 Apr 16:14
· 63 commits to main since this release

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 (sqlite BLOB).
  • 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 an Expr 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 to v0::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 behind dev feature which is enabled by default.
  • Updated dependencies.

Renaming

  • Renamed Dummy to Select.
  • Renamed Column to Expr.
  • Renamed try_insert to insert and insert to insert_ok.
  • Renamed try_delete to delete and delete to delete_ok.
  • Renamed try_update to update and update to update_ok.