commit | 83e34744362127410a4d50ddeb069ca5633ced40 | [log] [tgz] |
---|---|---|
author | Sean Griffin <sean@seantheprogrammer.com> | Wed May 09 10:35:02 2018 -0600 |
committer | Sean Griffin <sean@seantheprogrammer.com> | Wed May 09 10:39:39 2018 -0600 |
tree | a8cfbe2be8e9f64a3cfe9c5b4ab96f04319c41a9 | |
parent | 91993354238a0b5b08beb38a18490105a4bc0be5 [diff] |
Allow migrations to have attached metadata, avoid running in transaction On PostgreSQL, certain commands cannot be run inside of a transaction, such as `CREATE INDEX CONCURRENTLY` and `ALTER TYPE`. This causes problems when attempting to use Diesel migrations, since we always run these migrations inside a transaction. To allow opting out of this, we introduce the concept of migration metadata. I've opted to keep this incredibly general, rather than adding a specific `should_run_in_migration` function, as there's been interest expressed in having this capability to enable alternate migration runners. Since we need to retain object safety, we can't actually have any defined structure for the metadata. The best we can do is either something that is conceptually `Map<String, String>`, or an enum like `serde_json::Value` or `toml::Value`. I really don't want to restrict what can or cannot be in here, so I've opted for the more general option.
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.
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.