goeland
goeland
DTDrizzle Team
Created by seckraken on 6/14/2024 in #help
Create a view with Drizzle
Hello @Justin , Thanks for the response! Your suggestion works, but I need to use the query builder to avoid refactoring my entire codebase, particularly with the with clauses for including relations. I want to implement an "archived" feature and was considering using a view. However, I’m open to other solutions. I was wondering if Drizzle ORM supports middlewares, as they could potentially simplify this process, but it seems they might not be available. If using views is the best approach, do you know when the query builder will support working with views? Thanks a lot
8 replies
DTDrizzle Team
Created by seckraken on 6/14/2024 in #help
Create a view with Drizzle
Hello @Justin , I manually created the view and declared the view in my codebase with the pgView from 'drizzle-orm/pg-core', but I can't find a way to query this view. I expected the db.query.myView.findMany() to work but myView does not exist on type.... Is there some documentation explaining how to query views with drizzle-orm ? Thanks !
8 replies