Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for per per-query types (#1825)
The documentation states that you can pass custom type processors to query objects. See: https://node-postgres.com/features/queries#types This didn't actually work. This commit adds an initial implementation of per-query type-parsing. Caveats: * It does not work with pg-native. That would require a separate pull request to pg-native, and a rather significant change to how that library handles query results. * Per-query types do not "inherit" from types assigned to the Client, ala TypeOverrides.
- Loading branch information
Showing
3 changed files
with
29 additions
and
11 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
566058d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twooster @brianc This breaks using types in pg-cursor btw - https://github.com/brianc/node-pg-cursor/blob/master/index.js#L53-L55
It seems like this was an undocumented attribute, but if other libraries were relying on it this should have been published as a breaking change.