chaoss / chaoss/CollectOSS

Evaluate alembic-utils-extended for materialized view + index management

Open
#314 1 comment 0 reactions 0 assignees View on GitHub
dependencies
Dominant language
Python
Stars
13
Forks
17
Avg merge
6h 59m
Merged PRs (30d)
1

Description

Spinning out from #292 review (cc @MoralCode).

Stock `alembic_utils` ships `PGMaterializedView` for view definitions but doesn't track indexes. That's intentional, indexes are out-of-band for the library. PR #292 wraps it in a small dataclass that adds `unique_index_columns`, used by the refresh task to pick between `REFRESH MATERIALIZED VIEW CONCURRENTLY` and the non-concurrent path.

@MoralCode flagged [candidhealth/alembic-utils-extended](https://github.com/candidhealth/alembic-utils-extended), a fork that adds native index support via SQLAlchemy index types. Worth a real look so we stop carrying `unique_index_columns` ourselves.

Three options:

1. **Adopt candidhealth's fork.** Cleanest if it sticks, but 19 stars / 1 fork and last commit Dec 2025. hard to tell "stable and active" from "abandoned and stable."
2. **Add index support to stock `alembic_utils` and try to upstream.** If it lands, no fork at all. If the maintainer's slow, we vendor.
3. **Keep the wrapper.** ~10 lines; cost is just keeping `unique_index_columns` in sync with the DB.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.