You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add clear database usage instructions and safe reading examples
CRITICAL CHANGES:
- Add prominent warnings about using read-only mode for database access
- Create read_sensor_data.py - comprehensive safe reading example
- Update README with clear database best practices section
- Remove incorrect DELETE mode recommendations (WAL works everywhere)
- Update llm_docs.py with safe reading patterns
Key safety rule: ALWAYS use read-only mode when reading:
Python: sqlite3.connect('file:data/sensor_data.db?mode=ro', uri=True)
CLI: sqlite3 'file:data/sensor_data.db?mode=ro'
The simplified database uses WAL mode exclusively and works on all platforms.
No configuration needed - it just works with excellent performance (90k+ writes/sec).
- **Mac/Windows (Docker Desktop)**: Set `SENSOR_WAL=false` for DELETE mode
387
+
The database "just works" - no tuning or configuration needed!
411
388
412
389
### Manufacturer and Firmware Effects
413
390
@@ -426,9 +403,69 @@ Different manufacturers and firmware versions affect anomaly rates:
426
403
427
404
428
405
429
-
## 📊 Data Output
406
+
## 🗄️ Database Usage & Best Practices
407
+
408
+
### ⚠️ CRITICAL: Always Use Read-Only Mode When Reading
409
+
410
+
The sensor uses a simplified SQLite database with excellent performance. To prevent corruption, **ALWAYS** use read-only mode when reading while the sensor is running:
0 commit comments