Drizzle Kit: How to introspect Postgres DB without creating relations in generated schema?

I've got a monster of target database, with relations all over the show. I'm not interested in have a fully representative schema, and only want to perform read operations against a subset of tables. Using the tablesFilter doesn't work as the relations keep wanting to exist, even though the related tables aren't in my tablesFilter. Can I disable this feature completely?
1 Reply
zach
zach6mo ago
I'd be interested in this as well, since the relations files generate with errors for large db's. Currently I just added the following to my package.json script to remove the relations files after introspection: package.json
scripts: {
db-introspect: drizzle-kit introspect --config=src/clients/postgres/public/drizzle.config.ts && rm -rf src/clients/postgres/**/relations.ts
}
scripts: {
db-introspect: drizzle-kit introspect --config=src/clients/postgres/public/drizzle.config.ts && rm -rf src/clients/postgres/**/relations.ts
}
Add and modify && rm -rf src/clients/postgres/**/relations.ts to target the directory you want to clean up after introspection
Want results from more Discord servers?
Add your server