cornucopia-rs / cornucopia

Generate type-checked Rust from your PostgreSQL.
Other
755 stars 31 forks source link

Add `try_bind` function #235

Open erikschul opened 5 months ago

erikschul commented 5 months ago

cornucopia can panic when types are incorrect during row.get. This can cause a server to crash. This can occur when a table schema changes, and in particular, if nullability changes aren't updated correctly in all queries. (https://github.com/cornucopia-rs/cornucopia/issues/226)

Can you provide a function try_bind that uses try_get?

See this example: https://github.com/Dowwie/tokio-postgres-mapper