Charmander
Charmander
Also a good workaround. If you want to be compatible with the defaults, it’s ```typescript PG.types.setTypeParser(PG.types.builtins.BYTEA, (value: string) => Buffer.from(value, 'hex')); ```
Can you explain what the safety benefit is? I didn’t see anything stick out in https://github.com/gajus/slonik/pull/595 (especially) or https://github.com/gajus/slonik/issues/601.
> I believe the benefit is that you wouldn't be able to accidentally execute multiple statements. Right, how is that a benefit? Feels more like a false sense of security....
I don’t think this is necessarily a bad option to add, but it’d be nice to have concrete explanations of the motivations. What security vulnerabilities? Are unexpected results maybe better...
> > Are unexpected results maybe better addressed by checking if the result is an array? > > This could work, but only if every query was wrapped in its...
> This query-specific cancellation API only makes sense because the library waits for each query to complete before it submits the next. I’m pretty sure there are still unavoidable race...
Although this could just be a simplified example, I might as well mention that detecting braces is a bad idea, especially globally in every value processed by a pg client....
You’ll probably also want to set the (undocumented?) [`keepAliveIdleMillis` option](https://github.com/brianc/node-postgres/pull/1847) to a reasonably low value.
The reason `pool.end()` might appear to be working/work for some purposes, note, is that it does wait for all clients to be *idle* before resolving.
I’d think `end` itself should work like that (next major version?), but haven’t searched for and reviewed all the conversations about it.