Skip to content

refactor: decouple DefaultQueryProvider, search_utils, and Filter classes from SQLAlchemy - #33

Merged
borhanst merged 3 commits into
mainfrom
architecture-change
Jul 23, 2026
Merged

refactor: decouple DefaultQueryProvider, search_utils, and Filter classes from SQLAlchemy#33
borhanst merged 3 commits into
mainfrom
architecture-change

Conversation

@borhanst

@borhanst borhanst commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace direct SQLAlchemy imports in DefaultQueryProvider and apply_search_filter() with QueryBackend and IntrospectionBackend from app.state
  • Add ilike(), or_(), options() to QueryBackend protocol and SqlAlchemyQueryAdapter
  • Add introspection methods to IntrospectionBackend protocol and SqlAlchemyIntrospectionAdapter
  • Update Filter ABC and all 7 subclasses to accept QueryBackend and model separately
  • Remove all direct SQLAlchemy imports from filters/base.py
  • Update FilterRegistry.auto_generate() to use IntrospectionBackend
  • All 580 tests pass, linter clean

Closes #26
Closes #27

borhanst added 3 commits July 23, 2026 14:51
…#24/#25/#30)

Define protocol interfaces (IntrospectionBackend, SessionBackend,
QueryBackend, AuditBackend, DatabaseBackend) in backends/protocols.py
and implement the full set of SQLAlchemy adapters in backends/sqlalchemy.py.
Update inspection, db, and admin_database to delegate through adapters.
Replace direct SQLAlchemy imports in DefaultQueryProvider and
apply_search_filter() with QueryBackend and IntrospectionBackend
from app.state. Add ilike(), or_(), options() to QueryBackend and
introspection methods to IntrospectionBackend protocols.

Closes #26
Update Filter ABC and all 7 subclasses to accept QueryBackend and
model separately instead of using query.column_descriptions. Remove
all direct SQLAlchemy imports from filters/base.py. Update
FilterRegistry.auto_generate() to use IntrospectionBackend.

Closes #27
@borhanst borhanst changed the title refactor: decouple DefaultQueryProvider and search_utils from SQLAlchemy refactor: decouple DefaultQueryProvider, search_utils, and Filter classes from SQLAlchemy Jul 23, 2026
@borhanst borhanst mentioned this pull request Jul 23, 2026
5 tasks
@borhanst
borhanst merged commit d2d6f63 into main Jul 23, 2026
3 checks passed
@borhanst
borhanst deleted the architecture-change branch July 23, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple Filter Classes Decouple DefaultQueryProvider and Search Utils

1 participant