-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove FromDatum::NEEDS_TYPID const This constant was set to false in all every `FromDatum` implementation, and simply isn't necessary. Further changes to `FromDatum` are going to change how this idea worked in the first place. * Remove the `typid` argument from `FromDatum::from_datum()`. This argument was never actually used, only passed around. And in many cases it was set to `pg_sys::InvalidOid` anyways. * Eliminate this pattern during `FromDatum::from_datum()`: ```rust } else if datum == 0 { panic!("array was flagged not null but datum is zero"); } ``` As the function is already unsafe, there's no need for us to have a check for a case that is likely never going to happen. Postgres may send us a null datum, but as long as we check `is_null` first, we're okay. * `FromDatum` gets a new function, `try_from_datum()` This function ensures the desired Rust type is compatible with the backing Postgres type of the Datum being converted. If they're not compatible, an `Err` is returned rather than either panicking or leading to undefined behavior. It's not actually used anywhere yet. * Initial work on a new `PgHeapTuple` type. Currently it only knows how to construct itself in a few ways, along with retrieving named/indexed datum values (as runtime type-checked Rust values). There's a few breaking API changes in other places, especially in `htup.rs` and `PgTupleDesc` * default impl of a new IntoDatum::is_pass_by_value() function * fix compilation issues after merging from-datum-overhaul * a few more pass-by-value types * WIP: ability to set attribute values on a HeapTuple * Finish up the `PgHeapTuple` API, plus docs. Update the trigger example.
- Loading branch information
1 parent
c4ce4b9
commit d130652
Showing
30 changed files
with
679 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.