Is it possible to select 1 row?

Seems an annoying oversight that I have to implement variable[0] everytime, even though I'm matching unique IDs
2 Replies
Mykhailo
Mykhailo5mo ago
Hello, @mwjt42. It is how sql works, but you can try relational queries and findFirst method and get only 1 record. https://orm.drizzle.team/docs/rqb https://orm.drizzle.team/docs/rqb#find-first
Drizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
chocolate
chocolate5mo ago
Just do const [variable] = drizzle... when it returns an array with 1 data