All Versions
62
Latest Version
Avg Release Cycle
91 days
Latest Release
586 days ago

Changelog History
Page 6

  • v0.6.1 Changes

    April 14, 2016

    โž• Added

    • โž• Added the escape method to Like and NotLike, to specify the escape character used in the pattern. See EscapeExpressionMethods for details.

    ๐Ÿ›  Fixed

    • diesel_codegen and diesel_cli now properly rely on Diesel 0.6.0. The restriction to 0.5.0 was an oversight.

    • ๐Ÿ“‡ infer_schema! now properly excludes metadata tables on SQLite.

    • infer_schema! now properly maps types on SQLite.

  • v0.6.0 Changes

    April 12, 2016

    โž• Added

    • Queries can now be boxed using the into_boxed() method. This is useful for conditionally modifying queries without changing the type. See [BoxedDsl][boxed_dsl] for more details.

    • ๐Ÿ‘ infer_schema! is now supported for use with SQLite3.

    • The maximum table size can be increased to 52 by enabling the huge-tables feature. This feature will substantially increase compile times.

    • The DISTINCT keyword can now be added to queries via the distinct() method.

    • SqliteConnection now implements Send

    ๐Ÿ“„ [boxed_dsl]: https://docs.diesel.rs/diesel/prelude/trait.BoxedDsl.html

    ๐Ÿ”„ Changed

    • ๐Ÿ”€ diesel::result::Error now implements Send and Sync. This required a change in the return type of ToSql and FromSql to have those bounds as well.

    • It is no longer possible to pass an owned value to diesel::insert. insert will now give a more helpful error message when you accidentally try to pass an owned value instead of a reference.

    ๐Ÿ›  Fixed

    • #[insertable_into] can now be used with structs that have lifetimes with names other than 'a'.

    • Tables with a single column now properly return a single element tuple. E.g. if the column was of type integer, then users::all_columns is now (id,) and not id.

    • infer_schema! can now work with tables that have a primary key other than id.

    โœ‚ Removed

    • โœ‚ Removed the no select option for the table! macro. This was a niche feature that didn't fit with Diesel's philosophies. You can write a function that calls select for you if you need this functionality.
  • v0.5.4 Changes

    March 23, 2016
    • โšก๏ธ Updated diesel_codegen to allow syntex versions up to 0.30.0.
  • v0.5.3 Changes

    March 12, 2016

    โž• Added

    • Added helper function diesel_manage_updated_at('TABLE_NAME') to postgres upon database setup. This function sets up a trigger on the specified table that automatically updates the updated_at column to the current_timestamp for each affected row in UPDATE statements.

    • โž• Added support for explicit RETURNING expressions in INSERT and UPDATE queries. Implicitly these queries will still use RETURNING *.

    ๐Ÿ›  Fixed

    • โšก๏ธ Updated to work on nightly from early March
  • v0.5.2 Changes

    February 27, 2016
    • โšก๏ธ Updated to work on nightly from late February
  • v0.5.1 Changes

    February 11, 2016
    • Diesel CLI no longer has a hard dependency on SQLite and PostgreSQL. It assumes both by default, but if you need to install on a system that doesn't have one or the other, you can install it with cargo install diesel_cli --no-default-features --features postgres or cargo install diesel_cli --no-default-features --features sqlite
  • v0.5.0 Changes

    February 05, 2016

    โž• Added

    • โž• Added support for SQLite. Diesel still uses postgres by default. To use SQLite instead, add default-features = false, features = ["sqlite"] to your Cargo.toml. You'll also want to add default-features = false, features = ["sqlite"] to diesel_codegen. Since SQLite is a much more limited database, it does not support our full set of features. You can use SQLite and PostgreSQL in the same project if you desire.

    • โž• Added support for mapping types::Timestamp, types::Date, and types::Time to/from chrono::NaiveDateTime, chrono::NaiveDate, and chrono::NaiveTime. Add features = ["chrono"] to enable.

    • Added a treat_none_as_null option to changeset_for. When set to true, a model will set a field to Null when an optional struct field is None, instead of skipping the field entirely. The default value of the option is false, as we think the current behavior is a much more common use case.

    • โž• Added Expression#nullable(), to allow comparisons of not null columns with nullable ones when required.

    • โž• Added sum and avg functions.

    • โž• Added the diesel setup, diesel database setup, and diesel database reset commands to the CLI.

    • โž• Added support for SQL IN statements through the eq_any method.

    • โž• Added a top level select function for select statements with no from clause. This is primarily intended to be used for testing Diesel itself, but it has been added to the public API as it will likely be useful for third party crates in the future. select(foo).from(bar) might be a supported API in the future as an alternative to bar.select(foo).

    • โž• Added expression::dsl::sql as a helper function for constructing SqlLiteral nodes. This is primarily intended to be used for testing Diesel itself, but is part of the public API as an escape hatch if our query builder DSL proves inadequate for a specific case. Use of this function in any production code is discouraged as it is inherently unsafe and avoids real type checking.

    ๐Ÿ”„ Changed

    • ๐Ÿšš Moved most of our top level trait exports into a prelude module, and re-exported our CRUD functions from the top level. diesel::query_builder::update and friends are now diesel::update, and you will get them by default if you import diesel::*. For a less aggressive glob, you can import diesel::prelude::*, which will only export our traits.

    • Connection is now a trait instead of a struct. The struct that was previously known as Connection can be found at diesel::pg::PgConnection.

    • ๐Ÿ“‡ Rename both the #[derive(Queriable)] attribute and the Queriable trait to use the correct spelling Queryable.

    • load and get_results now return a Vec<Model> instead of an iterator.

    • Replaced Connection#find(source, id) with source.find(id).first(&connection).

    • The debug_sql! macro now uses ` for identifier quoting, and ? for bind parameters, which is closer to a "generic" backend. The previous behavior had no identifier quoting, and used PG specific bind params.

    • Many user facing types are now generic over the backend. This includes, but is not limited to Queryable and Changeset. This change should not have much impact, as most impls will have been generated by diesel_codegen, and that API has not changed.

    • ๐Ÿšš The mostly internal NativeSqlType has been removed. It now requires a known backend. fn<T> foo() where T: NativeSqlType is now fn<T, DB> foo() where DB: HasSqlType<T>

    โœ‚ Removed

    • Connection#query_sql and Connection#query_sql_params have been removed. These methods were not part of the public API, and were only meant to be used for testing Diesel itself. However, they were technically callable from any crate, so the removal has been noted here. Their usage can be replaced with bare select and expression::dsl::sql.
  • v0.4.1 Changes

    January 11, 2016

    ๐Ÿ”„ Changed

    • Diesel CLI will no longer output notices about __diesel_schema_migrations already existing.

    • Relicensed under MIT/Apache dual

  • v0.4.0 Changes

    January 08, 2016

    โž• Added

    • โž• Added Diesel CLI, a tool for managing your schema. See the readme for more information.

    • โž• Add the ability for diesel to maintain your schema for you automatically. See the migrations module for individual methods.

    • โž• Add DebugQueryBuilder to build sql without requiring a connection.

    • Add print_sql! and debug_sql! macros to print out and return sql strings from QueryFragments.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  #[changeset_for] can now be used with structs containing a Vec. Fixes #63.

    • โšก๏ธ No longer generate invalid SQL when an optional update field is not the first field on a changeset. Fixes #68.

    • #[changeset_for] can now be used with structs containing only a single field other than id. Fixes #66.

    • ๐Ÿ›  infer_schema! properly works with array columns. Fixes #65.

  • v0.3.0 Changes

    December 04, 2015

    ๐Ÿ”„ Changed

    • โšก๏ธ #[changeset_for(table)] now treats Option fields as an optional update. Previously a field with None for the value would insert NULL into the database field. It now does not update the field if the value is None.

    • ๐Ÿ”„ .save_changes (generated by #[changeset_for]) now returns a new struct, rather than mutating self. The returned struct can be any type that implements Queryable for the right SQL type

    ๐Ÿ›  Fixed

    • #[derive(Queryable)] now allows generic parameters on the struct.

    • ๐Ÿ‘ Table definitions can now support up to 26 columns. Because this increases our compile time by 3x, features = ["large-tables"] is needed to support table definitions above 16 columns.

    โž• Added

    • Quickcheck is now an optional dependency. When features = ["quickcheck"] is added to Cargo.toml, you'll gain Arbitrary implementations for everything in diesel::data_types.

    • โž• Added support for the SQL MIN function.

    • โž• Added support for the Numeric data type. Since there is no Big Decimal type in the standard library, a dumb struct has been provided which mirrors what Postgres provides, which can be converted into whatever crate you are using.

    • Timestamp columns can now be used with std::time::SystemTime when compiled with --features unstable

    • ๐Ÿ‘ Implemented Send on Connection (required for R2D2 support)

    • Added infer_schema! and infer_table_from_schema!. Both macros take a database URL, and will invoke table! for you automatically based on the schema. infer_schema! queries for the table names, while infer_table_from_schema! takes a table name as the second argument.