seckraken
DTDrizzle Team
•Created by seckraken on 6/14/2024 in #help
Create a view with Drizzle
Hi, need some help to understand how i can create a view with Drizzle.
"drizzle-orm": "^0.31.2",
"drizzle-kit": "^0.22.6",
export const wf_users_in_private_view = pgView("wf_users_in_private_view", {
wf_id: text('wf_id'),
user_id: text('user_id'),
}).as(sql
SELECT DISTINCT ${workflows.id}, jsonb_array_elements(${workflows.data}->'nodes')->'data'->>'id' FROM ${workflows} WHERE ${workflows.is_private} = true
)
On "npm run generate", and reading Drizzle document i was expected to have an output of "CREATE VIEW", but have:
No schema changes, nothing to migrate 😴8 replies