Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tighter integration into node-postgres #1

Open
brianc opened this issue May 13, 2013 · 0 comments
Open

tighter integration into node-postgres #1

brianc opened this issue May 13, 2013 · 0 comments

Comments

@brianc
Copy link

brianc commented May 13, 2013

Hello - author of node postgres here. Was reading your readme about not having clean hook points into the type parsing API. I implemented something for using parseFloat for numeric types here:

https://github.com/brianc/node-pg-parse-float

Similar to your module it adds some type deserialization back in. Maybe have a look there for how I handled it? Removes the burden of having to add the type parser manually to the consumer. I can definitely whip this up in a pull request for you if you want.

As far as the serialization part is concerned, I'm not sure how it would be possible to know when to serialize an object to an hstore value on the way in to the database? As far as I'm able to figure out node-postgres would have to query the metadata on the table & keep track of which columns were hstore and which were not so it would know when to serialize query parameters to hstore values. That's why there's no way to provide 'custom' serializers...they pretty much need to live in the consuming modules as far as I was able to reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant