How can we get all tables names
So i want to get all tables names i have in my schema.ts
found this https://orm.drizzle.team/docs/goodies#get-table-information but it doesnt fit my use case
Drizzle ORM - Goodies
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
5 Replies
This should work:
thanks !
If you have relations in your schema and want to filter them, you can Object.values(schema) and filter with is(table, PgTable) (or MySqlTable etc).
Then get the keys like Quintisimo
alright im gonna need that too thanks
(for the context im currently building a tool to autogenerate database documentation and it will supports drizzle alongside with other ORM's)
Nice! I am working in table and relation viewer!
I can’t open source the code now but if you need to find something in particular, do not hesitate.
I am working on cleaning my table parser today