Skip to content

[DATABASE] Implement insert and query functions #24

Closed
ezehf2 opened this issue Mar 11, 2026 · 0 comments
Closed

[DATABASE] Implement insert and query functions #24

ezehf2 opened this issue Mar 11, 2026 · 0 comments
Assignees

Comments

@ezehf2
Copy link
Owner

ezehf2 commented Mar 11, 2026

Create database.py in the database/ folder. Must include the following functions: insert_reading(sensor_id, value, unit, timestamp) to insert a new sensor reading, insert_alert(room_id, sensor_type, value, threshold, timestamp) to insert a new alert, get_latest_readings() to return the most recent reading for each room and sensor type, and get_active_alerts() to return all unresolved alerts. All functions must use the schema defined in schema.sql. Test each function locally before committing. Commit with message [DATABASE] Add insert and query functions and reference this issue.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
Development

No branches or pull requests

2 participants