Closed jamiehaywood closed 3 weeks ago
My current workaround is:
const [ first ] = await db
.select()
.from(schema.books)
.where((b) => eq(b.id, book.id));
I reread the docs, and to use the query builder, you need to pass schema in as the second argument to the db constructor:
const db = drizzle<typeof schema>(sqlite, { schema });
^^^^^
What version of
drizzle-orm
are you using?0.31.2
What version of
drizzle-kit
are you using?0.22.5
Describe the Bug
The above query fails with
TypeError: Cannot read properties of undefined (reading 'findFirst')
.If I change the driver to better-sqlite3 it's the same.
Expected behavior
To be able to run
findFirst
queriesEnvironment & setup
No response