© 2026 Hedgehog Software, LLC
await db.query.Session.findMany({})
await db.query.Session.findMany({ with: {User: true} })
TypeError: Cannot read properties of undefined (reading 'referencedTable')
export const Session = pgTable("Session", { sessionToken: text("sessionToken").notNull(), userId: text("userId").notNull().references(() => User.id, { onDelete: "cascade", onUpdate: "cascade" } ),...
export const User = pgTable("User", { id: text("id").primaryKey().notNull(), ...
relations.ts