san4d
Explore posts from serversDTDrizzle Team
•Created by san4d on 4/22/2024 in #help
Error with Nested Transactions
I'm experiencing an issue with nested transactions on neon serverless 0.9.1, drizzle-orm 0.30.9, and ws 8.16.0.
The following works locally but not in production:
The following works in production but not locally:
I'd expect the 1st (parent-child transactions) to work. Instead, I get a 25P01 error
NO_ACTIVE_SQL_TRANSACTION
with message
error: ROLLBACK TO SAVEPOINT can only be used in transaction blocks\n at file:///var/task/dist/server/entry.mjs:148485:23\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async _NeonTransaction.transaction
5 replies
DTDrizzle Team
•Created by san4d on 4/11/2024 in #help
Parameterized Interval in Where Clause
I'm trying to write a query that uses an interval as a parameter. The SQL looks like this and works fine:
When I try to write it using drizzle, it also works fine if a hard code the interval:
However, it does not work if I try to parameterize the interval like this:
or this:
I get this error
Error: could not determine data type of parameter $3I tried this and got this error
operator does not exist: interval < timestamp with time zoneSince the raw SQL works, I must be missing something in the ORM usage. Any suggestions? I'm running Postgres 16 on neon using drizzle 0.30.7.
4 replies
DTDrizzle Team
•Created by san4d on 1/31/2024 in #help
Error when making a websocket-based transaction on an AWS Lambda Function
Problem
I'm seeing this error when I try to make a connection:
I'm able to make HTTP calls no problem.
Setup
- Node 18.v20 Runtime on AWS Lambda
- Postgres 16 on Neon
- @Neondatabase/serverless v0.6.1
- drizzle-orm v0.29.3
- ws v8.16.0
Ask
Has anyone ran into this before? If so, what did you you need to change? I'm looking into the
bufferUtil2.mask
error currently.
Solution
I figured out that I needed to add bufferutil as an optional dependency:
3 replies