King of the Short Bus
DTDrizzle Team
•Created by King of the Short Bus on 4/3/2024 in #help
findFirst returns array instead of entity - using aws-data-api/pg
Hi folks -- I'm using
aws-data-api/pg
, running the latest version ("drizzle-orm": "^0.30.7"
).
I'm seeing something where my query.<table>.findOne()
call is correctly typed as <entity>|undefined
, and the LIMIT 1
clause is showing up in the SQL, but I'm actually getting back results of the form [<entity>]
or []
, as I would expect from findMany()
.
Code:
Log 1 (entity found):
Log 2 (entity not found):
Changing the code to findMany()
changes the type expected by my IDE, but the logs show the same output (same SQL minus the LIMIT 1
, and exact same resulting data).
Am I doing something wrong here, or should I file a bug?4 replies