Drizzle-kit not detecting views ?
Hi, I've created a view in the same file as my regular table:
But drizzle kit says that no changes were made.
No schema changes, nothing to migrate 😴Did I miss something ?
9 Replies
this is an known limitation
You can see the warning in the docs https://orm.drizzle.team/docs/views
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
You'll need to add the views manually to your migration file
ohh, okay
thanks mate
I hope it is coming soon ;)
how do you actually query the view?
await db.select().from(View)
doesn't work for me. It is saying that relation "pg_view" does not exist
. What is going on?
@Cyber Grandma if you help me with that I can help you with centering a divThe view needs to have been defined in the database for you to use it
If I remember correctly, drizzle-kit doesn't support views yet. So you'll need to define them manually
GitHub
Feat: Use views in relations by Angelelz · Pull Request #1778 · dri...
close #769
Added types and correct handling of Views to relations and alias
Added correct handling of Views to the dialect for RQB and correct types to the query builder
Added schema for integrati...
seems like drizzle-kit is not open source, and that's where the feature needs to be added, right?
Correct