Have `PgTypeMetadata` be an enum

The big benefit of this change is that the signature of
`TypeMetadata::metadata` doesn't need to change. We get to remove a lot
of the random `_: &()`, which is nice. The only code that isn't PG
specific that needs to change with this version is the signature of
`ToSql`.

However, I don't like this version, and I don't think I'm going to go
forward with it. This implementation has a lot more coupling to the
metadata lookup. Prior to this commit, the only time you have to know or
care about the lookup is when you are doing a dynamic lookup (and that
code has to care about the lookup either way).

However, with this form, anyone who needs an OID *also* has to care
aboute how exactly we go about getting it. I also don't like the idea
that you can get metadata that is sometimes useless unless you also have
another parameter. If we need the lookup to get the OID, we should
enforce that we always have it when we need an OID.
15 files changed
tree: 47c1e58d8eae595fb6e209521b0b1da5241a9178
  1. .github/
  2. bin/
  3. diesel/
  4. diesel_cli/
  5. diesel_codegen/
  6. diesel_compile_tests/
  7. diesel_infer_schema/
  8. diesel_tests/
  9. examples/
  10. guide_drafts/
  11. migrations/
  12. .appveyor.yml
  13. .editorconfig
  14. .env.sample
  15. .gitignore
  16. .travis.yml
  17. Cargo.toml
  18. CHANGELOG.md
  19. clippy.toml
  20. code_of_conduct.md
  21. CONTRIBUTING.md
  22. LICENSE-APACHE
  23. LICENSE-MIT
  24. README.md
README.md

A safe, extensible ORM and Query Builder for Rust

Build Status Appveyor Build Status Gitter Crates.io

Documentation

Homepage

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”.

Getting Started

You can find an extensive Getting Started tutorial at http://diesel.rs/guides/getting-started. Guides on more specific features will be coming soon.

Code of conduct

Anyone who interacts with Diesel in any space including but not limited to this GitHub repository is expected to follow our code of conduct

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.