Open adrian-mohara opened 7 months ago
I enabled the logger to display the query directly in the RDS console and it runs correctly, it seems to be an internal drizzle problem.
I was able to run the query with this workaround using sql to do the explicit cast.
const orderUUID = '077b2bd8-98f1-469c-a49d-d520b3d47978'
const queryResult = await db.query.order.findFirst({
where: sql`${order.uuid} = CAST(${orderUUID} as UUID)`,
with: {
organization: true
}
});
Up
Up !
nvm, seems fixed with 0.32.2 🎉
What version of
drizzle-orm
are you using?0.30.8
What version of
drizzle-kit
are you using?0.20.14
Describe the Bug
When I do a query combining where with with, I get the following error using rds-data-api:
BadRequestException: ERROR: operator does not exist: uuid = character varying Hint: No operator matches the given name and argument types. You might need to add explicit type casts. Position: 670; SQLState: 42883
The query works separately, I created another query with only the where statement and it worked, just as it does if I create another query with only the with statement.
I tried the same query with the neon driver and it works without problem, it seems to be only a problem with rds-data-api.
The schema:
The query:
Expected behavior
Able to use where and with in the same query.
Environment & setup
Aurora Postgres Database using RDS-Data-API