|
| 1 | +# Decision Log |
| 2 | + |
| 3 | +## Technical Decisions |
| 4 | + |
| 5 | +### 2026-03-29: NAPI Exception Handling |
| 6 | + |
| 7 | +**Decision**: Use `node_addon_api_except` instead of `NAPI_DISABLE_CPP_EXCEPTIONS=1` |
| 8 | + |
| 9 | +**Rationale**: |
| 10 | +- Commit 48e95e8a0d32277449c269b41fba6419acb21418 changed the build configuration |
| 11 | +- Using `node_addon_api_except` from node-addon-api provides proper exception handling support |
| 12 | +- This is the recommended approach for modern node-addon-api versions |
| 13 | + |
| 14 | +**Files Changed**: |
| 15 | +- `binding.gyp`: Changed from `node_addon_api` to `node_addon_api_except` dependency |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +### 2026-03-28: Memory Bank Structure |
| 20 | + |
| 21 | +**Decision**: Adopt UMB (Update Memory Bank) workflow with standard file structure. |
| 22 | + |
| 23 | +**Rationale**: Following 2026 community standards for AI agent context management. |
| 24 | + |
| 25 | +**Files Created**: |
| 26 | +- `activeContext.md` - Current work status |
| 27 | +- `progress.md` - Completed work history |
| 28 | +- `decisionLog.md` - Technical decisions record |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +### Promisification Architecture |
| 33 | + |
| 34 | +**Decision**: Create Promise-based wrapper classes alongside callback-based classes. |
| 35 | + |
| 36 | +**Status**: ✅ IMPLEMENTED |
| 37 | + |
| 38 | +**Rationale**: |
| 39 | +- Maintains backward compatibility with existing callback API |
| 40 | +- Provides modern async/await support |
| 41 | +- Follows established pattern from sqlite3orm reference implementation |
| 42 | + |
| 43 | +**Implementation**: |
| 44 | +- New classes: `SqliteDatabase`, `SqliteStatement`, `SqliteBackup` |
| 45 | +- Exported from `lib/promise/index.js` |
| 46 | +- Generic type parameters for TypeScript type inference |
| 47 | +- Transaction support with `beginTransaction()`, `commitTransaction()`, `rollbackTransaction()` |
| 48 | +- Static factory method `SqliteDatabase.open()` |
| 49 | + |
| 50 | +**Alternatives Considered**: |
| 51 | +1. Modify existing classes to return Promises - Rejected (breaks backward compatibility) |
| 52 | +2. Create separate package - Deferred (can be refactored later if needed) |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +### Node.js Version Requirement |
| 57 | + |
| 58 | +**Decision**: Require Node.js >= 20.17.0 |
| 59 | + |
| 60 | +**Rationale**: |
| 61 | +- Modern NAPI support |
| 62 | +- Latest performance improvements |
| 63 | +- Simplified maintenance |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +### Build System Choice |
| 68 | + |
| 69 | +**Decision**: Use node-gyp with prebuild for binary distribution |
| 70 | + |
| 71 | +**Rationale**: |
| 72 | +- Established tool for native addons |
| 73 | +- Prebuilt binaries reduce installation friction |
| 74 | +- Supports multiple NAPI versions (3, 6) |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### SQLite Configuration |
| 79 | + |
| 80 | +**Decision**: Bundle SQLite with enabled extensions |
| 81 | + |
| 82 | +**Extensions Enabled**: |
| 83 | +- `SQLITE_THREADSAFE=1` - Thread safety |
| 84 | +- `SQLITE_ENABLE_FTS3/4/5` - Full-text search |
| 85 | +- `SQLITE_ENABLE_RTREE` - R-Tree index |
| 86 | +- `SQLITE_ENABLE_DBSTAT_VTAB=1` - Database stats |
| 87 | +- `SQLITE_ENABLE_MATH_FUNCTIONS` - Math functions |
| 88 | + |
| 89 | +**Rationale**: Provides comprehensive SQLite functionality out of the box. |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +### Test Framework |
| 94 | + |
| 95 | +**Decision**: Use mocha with 480s timeout |
| 96 | + |
| 97 | +**Rationale**: |
| 98 | +- Established test suite |
| 99 | +- Handles async operations well |
| 100 | +- Compatible with existing tests |
0 commit comments