commit | 67d33d9680a49858d2033a7eec40c9be50db80ae | [log] [tgz] |
---|---|---|
author | Sean Griffin <sean@seantheprogrammer.com> | Wed Oct 03 12:23:19 2018 -0600 |
committer | Sean Griffin <sean@seantheprogrammer.com> | Wed Oct 03 13:22:37 2018 -0600 |
tree | f34161190260408bbb531803092f5f11e4db5951 | |
parent | db66040008c7e951e1be74a199a309e9142d175f [diff] |
Support `diesel_manage_updated_at` on SQLite There's a little bit of funkiness required to make this work. The first piece is that we need to modify the function registration to provide access to the connection for our internal functions. This isn't *strictly* necessary, we could `transmute` the `&self` to be `&'static self`, since the function will never be called after `self` is dropped. That felt like it would add some unneccessary unsafety though. The second bit of funkiness is that we have to have *some* return type, so we can't just return `()`. I think I want to fix this in the future by providing a `Null` SQL type, which provides `ToSql` and `FromSql` impls only for `()`. This requires adding a variant to `SqliteType` and `MysqlType` though, so it will have to be done in 2.0. The function itself is subtly different from the PostgreSQL version, since it runs even if no values were actually changed (we can't do something like `NEW IS DISTINCT FROM OLD` here). This also cannot be run on tables without ROWIDs. I think we should probably declare this as a SQL function in code somewhere for documentation purposes, but I want to wait until our docs are building again to follow up with that.
API Documentation: latest release – master branch
Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance. It takes full advantage of Rust's type system to create a low overhead query builder that “feels like Rust.”
Find our extensive Getting Started tutorial at https://diesel.rs/guides/getting-started. Guides on more specific features are coming soon.
If you run into problems, Diesel has a very active Gitter room. You can come ask for help at gitter.im/diesel-rs/diesel. For help with longer questions and discussion about the future of Diesel, visit our discourse forum.
Anyone who interacts with Diesel in any space, including but not limited to this GitHub repository, must follow our code of conduct.
Licensed under either of these:
Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.