-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
databaseneeds-triageNew issue that hasn't been reviewed/prioritized yetNew issue that hasn't been reviewed/prioritized yettaskGeneral work item (implementation, setup, cleanup) – most common labelGeneral work item (implementation, setup, cleanup) – most common label
Milestone
Description
Description
Implement reusable, type-safe, async CRUD operations for the main entities so both Appliance and Assistant can safely read/write without duplicating logic.
Type
- Task
Focus Area (pick one)
- Shared Utils & Models
Priority
- Medium
Acceptance Criteria
- File:
shared/src/database/crud.py - Async CRUD operations for:
- Incidents: create, get_by_id, get_recent, get_by_device_mac, mark_resolved
- ModelRegistry: create_new_version, get_latest, get_by_hash, list_versions
- PolicyAudits: log_action, get_for_incident
- All functions accept
AsyncSessionfromsession.py - Use SQLAlchemy 2.0
select()/insert()/update()style - Return Pydantic models via
.model_validate(db_obj) - Basic filtering + pagination (limit / offset)
- Proper exception handling (custom
NotFoundError,DuplicateError, etc.) - Unit tests covering happy path + edge cases (no results, constraint violations)
- Full Google-style docstrings
- Type annotations; mypy strict clean
Blocker / Dependencies
- [Database] Implement robust async SQLite session factory + connection pooling
- [Database] Define Pydantic v2 models and initial relational schema
Notes / Links
- Related files:
shared/src/database/schemas.py,shared/src/database/models.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
databaseneeds-triageNew issue that hasn't been reviewed/prioritized yetNew issue that hasn't been reviewed/prioritized yettaskGeneral work item (implementation, setup, cleanup) – most common labelGeneral work item (implementation, setup, cleanup) – most common label
Projects
Status
Manual QA Testing