Cannot read properties of undefined (reading 'findMany')

Hello, I have a simple schema and an empty table and I can call my database wiith sqllike query but not with the querybuilder, i dont understand why, am I missing something?

ty guys

const accounts = pgTable('accounts', {
  id: serial('id').primaryKey(),
});

module.exports = { accounts }

const con = drizzle('postgres://postgres:root@localhost:5432/eurotruck')
const { accounts }= require('../../../db/schema')
const manies = await con.select().from(accounts) 
// => []
const manies2 = await con.query.accounts.findMany() 
// = Cannot read properties of undefined (reading 'findMany')
Was this page helpful?