Skip to content

feat!: replace raw SQL with SQLAlchemy ORM - #11

Open
chestercheng wants to merge 1 commit into
mainfrom
feat/sqlalchemy-orm
Open

feat!: replace raw SQL with SQLAlchemy ORM#11
chestercheng wants to merge 1 commit into
mainfrom
feat/sqlalchemy-orm

Conversation

@chestercheng

Copy link
Copy Markdown
Contributor

Summary

  • Replace raw SQLite queries with SQLAlchemy ORM models and sessions.
  • Replace DB_PATH with DATABASE_URL; SQLite remains the default.
  • Add SQLite ORM behavior tests using in-memory SQLite with raw SQL assertions.

Breaking Change

DB_PATH is replaced by DATABASE_URL. Use sqlite:///argus.db locally or sqlite:////data/argus.db for the Compose volume.

Validation

  • uv run pytest tests/dashboard tests/kktix
  • uv run ruff check .
  • uv run ruff format --check .

Define ORM models and use managed sessions for all database access. Configure connections with DATABASE_URL and keep SQLite as the default engine.

BREAKING CHANGE: replace DB_PATH with DATABASE_URL.

Signed-off-by: chestercheng <hi@chester.ch>
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.

1 participant