pax
pax
Explore posts from servers
DTDrizzle Team
Created by pax on 4/26/2024 in #help
Querying a materialized view: relation does not exist
I define a materialized view as such:
export const usersMv = pgMaterializedView("users_mv").as(
(qb) => {
return qb
.select({
name: users.name,
})
.from(users)
}
)
export const usersMv = pgMaterializedView("users_mv").as(
(qb) => {
return qb
.select({
name: users.name,
})
.from(users)
}
)
Then I query this materialized view:
const results = await db
.select()
.from(usersMv)
const results = await db
.select()
.from(usersMv)
But I get the error:
NeonDbError: relation "users_mv" does not exist
NeonDbError: relation "users_mv" does not exist
I'm using Neon. Does Drizzle know how to create the materialized view for me?
4 replies