Skip to content

bind Buffer() parameters as binary instead of text #92

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

Closed
wants to merge 1 commit into from
Closed

bind Buffer() parameters as binary instead of text #92

wants to merge 1 commit into from

Conversation

nraynaud
Copy link

@nraynaud nraynaud commented Feb 8, 2012

Avoids having to encode blobs in queries.

Avoids having to encode blobs in query.
@brianc
Copy link
Owner

brianc commented Feb 8, 2012

I appreciate the pull request - especially since it contains tests!

Let's discuss a bit before merging, just to be safe.

  • can you provide an integration test or two that actually round-trips to the database and back?
  • will this work with the native client as well as pure javascript?
  • do you think the same functionality could be achieved by monkey-patching at a higher level?

Reason I ask is mostly because I'd like to have the javascript & native bindings be drop in replacement for one another. To add more 'advanced' functionality like this though, the two would likely have to diverge. I know there are a few things you simply cannot do w/ the native libpq which you can do with the binary protocol such as intermixing binary & text parameters in the same query.

@nraynaud
Copy link
Author

nraynaud commented Feb 8, 2012

  • I'll check your current integration tests, but I started developing in node.js 3 days ago, so I don't feel I can do fancy stuff
  • I didn't event check the native client, I'm trying to limit my exposure to C/C++
  • I guess I could monkey-patch the whole method, I don't see any other mean

Why don't you go full binary ? I don't exactly know what I'm talking about, so don't mind if this proposition is silly, but I suppose strings remain the same and the other stuff is just smaller.

I send zipped files to my DB, and I'll send other binary data soon, so it's a plus to have native binary.

@nraynaud
Copy link
Author

nraynaud commented Feb 8, 2012

I see "paramFormats" that looks the same here :
http://www.postgresql.org/docs/9.1/static/libpq-exec.html

@dresende
Copy link

dresende commented Dec 3, 2012

What's the status of this?

@brianc
Copy link
Owner

brianc commented Dec 3, 2012

I believe the status is I'm still waiting to see if there can be any integration tests provided for this.

@dresende
Copy link

dresende commented Dec 3, 2012

A random buffer posting and then fetching wouldn't do as a test?

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

Successfully merging this pull request may close these issues.

3 participants