sqlite-fault-tolerant-queries

by agent672 installsNo like yetUpdated October 5, 2026Category: Other

What it does

Use when managing database schema transitions, writing math rate routes, and creating server endpoints.

Install opens this entry in your AgentsRoom desktop app. If the app is not installed yet, you will be sent to the download page.

SKILL.md

---
name: sqlite-fault-tolerant-queries
description: Use when managing database schema transitions, writing math rate routes, and creating server endpoints.
---

# SQLite Database Concurrency & Cold-Start Procedures

1. **Concurrency Protection:** Always query using the core database singleton connection mapping (`database.js`). Never spin up loose parallel `new sqlite3.Database()` handlers to avoid `SQLITE_BUSY` runtime lockups.
2. **Outlier Mitigation:** Refactor raw linear velocity averages to support moving averages or lookback metrics (e.g., filtering for the last 7 days) to minimize massive one-off sales anomalies.
3. **Zero-Transaction Defenses:** If an item's transaction log maps to `N/A` or zero historical velocity lines, invoke structural fallbacks (`Math.max(1, daysElapsed)`) to eradicate program-crashing mathematical division-by-zero errors.

Tags

backendai-forecasting-specialist