drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: indexes on materialized views
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
Currently it is not possible to add indexes on materialized views.
The [documentation](https://orm.drizzle.team/docs/indexes-constraints#indexes) explains quite well how to create indexes on tables. This is done by providing the third argument to pgTable call, like this:
```ts
export const user = pgTable("user", {
id: serial("id").primaryKey(),
name: text("name"),
email: text("email"),
}, (table) => {
return {
nameIdx: index("name_idx").on(table.name),
emailIdx: uniqueIndex("email_idx").on(table.email),
};
});
```
However, `pgMaterializedView` does not accept a third argument at all, even though it is possible to add indexes on materialized views in postgresql. Please add a possibility to define indexes on materialized views. 🙏🏼
Contributor guide
Assessment
This issue has not been assessed yet.