drizzle.query doesn't work with tables outside `public` schema

I can't make the drizzle query syntax work with tables in my custom schema. Am I missing something? This is a reduced example of my setup:
// db/schema/index.ts

const customSchema = pgSchema('custom')
const foo = customSchema.table('foo', ...)

// db/index.ts
const drizzle = db(conn, { schema, logger: true })

// example/page.tsx

db.query.foo.findMany();

// run, expected: select "id" from "custom"."foo"
Query: select "id" from "foo";
PostgreSQLError: relation "foo" doesn't exist

---
Although it's not documented I tried db.query.custom.foo.findMany... with no success.
Was this page helpful?