feat: implement SQLite persistent storage for analysis results
- Implemented database initialization and connection management in `database.ts` using Bun's SQLite. - Created `runs` and `results` tables to track historical analysis metadata and detailed product performance. - Updated `writer.ts` to persist analysis results to the database within a transaction, replacing the previous CSV output logic. - Updated README and `.gitignore` to reflect the new persistent storage capability.
This commit is contained in:
13
README.md
13
README.md
@@ -91,7 +91,18 @@ Numeric parsing accepts plain numbers as well as formatted values like `$12.50`,
|
||||
4. **Keepa fetch** — batch the sellable (uncached) ASINs in a single API call (up to 100 per request)
|
||||
5. **Enrich** — fetch SP-API pricing + FBA/FBM fees for sellable ASINs; combine with Keepa data and spreadsheet data
|
||||
6. **LLM analysis** — send batches of 5 sellable products to LM Studio for FBA/FBM/SKIP verdict; skipped ASINs get auto-SKIP verdict (confidence 100) and bypass LLM entirely
|
||||
7. **Output** — print results table to console (includes all ASINs), optionally write CSV/XLSX
|
||||
7. **Output** — print results table to console (includes all ASINs), optionally write CSV/XLSX, and **persist results to a SQLite database**.
|
||||
|
||||
## Persistent Storage with SQLite
|
||||
|
||||
Results from each run are now stored in a SQLite database named `results.db` in the project root. The SQLite implementation details are handled in `src/database.ts`. This allows you to:
|
||||
- Revisit past analysis results.
|
||||
- Query and analyze historical data.
|
||||
- Track product performance over time.
|
||||
|
||||
The database will automatically be created if it doesn't exist. Two tables are created:
|
||||
- `runs`: Stores metadata about each analysis run (timestamp, input file, output file, and summary counts).
|
||||
- `results`: Stores detailed analysis results for each product from each run, linked to the `runs` table.
|
||||
|
||||
## Output columns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user