No transactions support in neon-http driver even though neon provides a transaction function
https://neon.tech/docs/serverless/serverless-driver#when-to-use-the-neon-function-vs-pool-or-client
I tried to execute a db operation such as below. I am getting
throw new Error('No transactions support in neon-http driver');
I'm not sure if the kind of code below is an "interactive" or "non-interactive" transaction, but wondering if maybe I am missing something. Does drizzle support the neon(...) transaction()
function?
Neon
Neon serverless driver - Neon Docs
The Neon serverless driver is a low-latency Postgres driver for JavaScript and TypeScript that allows you to query data from serverless and edge environments over HTTP or WebSockets in place of TCP. Y...
11 Replies
same here
got that issue
https://discord.com/channels/1043890932593987624/1149312377142124616
It's not supported on a neon side
that's why it's not supported in drizzle
at least it wasn't when we were adding a support for new neon driver
I need to double check their docs, maybe it's supported already
It looks like it might be? https://github.com/neondatabase/serverless#transaction
GitHub
GitHub - neondatabase/serverless: Connect to Neon PostgreSQL from s...
Connect to Neon PostgreSQL from serverless/worker/edge functions - GitHub - neondatabase/serverless: Connect to Neon PostgreSQL from serverless/worker/edge functions
oh, nice, then we should add a support for it
I thought neon only allowed transactions while using the serverless driver + a web socket connection
let me find it
Neon
How do I handle transactions?
I am having this problem too, I thought they would have support for transactions for all postgres db’s…
When to use the neon function vs Pool or Client The Neon serverless driver supports the neon function for queries over HTTP, and Pool and Client constructors for querying over WebSockets. The neon function Querying over an HTTP fetch request is faster for single, non-interactive transactions. If you do not require sessions or transactions, consider using HTTP for faster response times. ... The neon(...) function also supports issuing multiple queries at once in a single, non-interactive transaction using the transaction() function, which is exposed as a property of the query function. For example:
oh yeah
than it's the same as it was
becuase we have 2 drivers for neon
neon-serverless and neon-http
ah, i didn't understand if transactions in drizzle were "interactive" or "non-interactive" but it sounds like with rollbacks/savepoints this means they are interactive, thus no tx in the http driver. Sounds like tx could be supported in http driver only if non-interactive but not sure the use cases for non-interactive tx's
Hello, I'm using drizzle neon-http driver and I was trying to create a transaction to do a many2many insert but it's not permitted.
If I do the following it works
non-interactive transactions do the job, if the second insert fails nothing is added in the first insert. Is it supported by drizzle?