Skip to content

Commit cff72bd

Browse files
committed
Added error for attempts to use with outdated versions of ORM
1 parent fb4dfac commit cff72bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import type { AnyDrizzleDB, GeneratedData } from './types';
99

1010
export const buildSchema = <TDbClient extends AnyDrizzleDB<any>>(db: TDbClient): GeneratedData<TDbClient> => {
1111
const schema = db._.fullSchema;
12+
if (!schema) {
13+
throw new Error(
14+
"Schema not found in drizzle instance. Make sure you're using drizzle-orm v0.30.9 or above and schema is passed to drizzle constructor!",
15+
);
16+
}
1217

1318
let generatorOutput;
1419
if (is(db, MySqlDatabase)) {

0 commit comments

Comments
 (0)