-
Notifications
You must be signed in to change notification settings - Fork 203
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
Parameterized queries #17
Comments
Just wanted to say this project is very cool and I'm looking forward to parameterized queries. I've already added some tests to my |
Howdy! Author & long-time maintainer of a node.js postgres client. I semi-recently teased out the wire protocol implementation to a package with zero dependencies outside of node.js itself. I realize requiring node might be a no-go, but if there are changes we could make to work with this lib I'd be happy to help out. At the very least hope it serves as a good point of reference: https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol LMK how I can help! |
@brianc , from the OP on discord (https://discord.com/channels/933657521581858818/1212676471588520006/1212765102332182538) from last week
So I guess if you have some advice on making node Buffer API use optional/pluggable then we'd be off to the races :-). |
I think the buffer usage (node dependency) could be worked around with either a polyfill (babel used to ship a browser compatible polyfill, not sure if they still do?), or I could look into porting things from using node buffer into more low level standardized primitives (typed arrays, etc) at this point. The porting work would take more time & some benchmarking on my side, but using a polyfill should be relatively straight-forward I think. If I need to change things to |
Hey @brianc 👋 awesome to see you here! I've been meaning to reach out. You've pretty much summarised my thoughts, I was roughly going to follow these steps:
Initially this is all for parameterized queries, but I also want to swap the output to use the wire protocol #31. Currently it is using JSON to cross the WASM/JS boundary and we loose type information, Dates for example don't become JS Date objects. So that the next step, but it's much more involved, more changes needed to the C code. node-postgres is a really great project, and as we add more functionality for PGlite it's certainly going to influence our API design too. |
Some inscrutable buffers there! |
So cool! Please lemme know if there's anything I can do to help! I am happy
to change stuff such as explicit buffer imports on my side, though it looks
like that might not be needed?! This project looks super great btw - I can
see tons of use cases for it.
…On Thu, Mar 7, 2024 at 2:35 PM James Arthur ***@***.***> wrote:
Some inscrutable buffers there!
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMHIMFCZVFIZMWNI4CG63YXDFSDAVCNFSM6AAAAABD3XMIYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGM3TQNBRGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Definitely let us know if you need some guinea pigs! I haven't been this excited about in browser dB stuff since I first stumbled across electric itself! :) |
@brianc I've only been working on it in Node so far, and pg-protocol has been perfect. I expect we will find that changing One key thing I'm aiming for is that the core PGlite lib is self contained with no dependancies, Essentially we will compile them, including pg-protocol, in when building, that way in a JS only "buildless" browser environment it's a single include. @AntonOfTheWoods very happy to have guinea pigs! We should have something to test early next week, there will be bugs! |
ohhh that's awesome! |
Fo anyone following along here, there is much progress in #39 (it uses pg protocol for all IO). There is a dev build attached to the PR. |
Nice! Is there a feature checklist with progress? Or are we at the "hopefully ok" stage, and now we need to find the things that we didn't know we needed to know stage? |
In order to support parameterized queries we need to use the extended postgres wire protocol to pass queries.
The text was updated successfully, but these errors were encountered: