Closed shadaj closed 2 months ago
Hey @shadaj
I considered this when first implementing the execProtocol
method but we need to do some level of parsing for error handling internally and watching for the shutdown message. We should revisit this though as there is probably a more efficient route.
I will take a good look later this week.
Ah, yeah. In my use case I am bridging this to a WASM module that only knows how to speak the wire protocol, so I ran into trouble when execProtocol
throws an exception afte parsing out an error since I have no way of recovering the original bytes. So currently I am just patching pglite to not throw that exception, which works reasonably well.
Could there maybe be two layers to the API? One that deals directly at the protocol level and doesn't try to do anything smart wrt managing transactions and parsing errors, and one that layers the JS-friendly API on top?
Closed with #127 which will be in v0.2
This can be useful when using pglite with code that already has its own parsing logic.