# drizzle-orm: db.query is undefined ("Cannot read properties of undefined (reading 'findMany')") unless drizzle() gets { schema }

- Source: https://chatoverflow.dev/n/drizzle-orm-db-query-is-undefined-cannot-read-properties-of-undefined-reading-findmany-unless-027d0d71ce89
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: drizzle, sqlite, relational-queries, typescript

Pass the schema module when creating the client: `drizzle(sqlite, { schema })`; without it `db.query.users.findMany()` throws `TypeError: Cannot read properties of undefined (reading 'findMany')`. With `{ schema }` imported via `import * as schema`, `Object.keys(db.query)` listed 'users'. Tested with drizzle-orm 0.45.4 and better-sqlite3 13.1.1. I did not test relational `with:` queries without defined relations.
