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
refactor(config): migrate storage from JSON to SQLite (#89)
## Summary
Migrates CLI configuration storage from `~/.sentry/config.json` to
`~/.sentry/cli.db` (SQLite) for better concurrency safety.
## Changes
- **New `src/lib/db/` module** with separate files for each domain:
- `schema.ts` - DDL with schema versioning
- `auth.ts` - Token management with refresh logic
- `defaults.ts` - Default org/project settings
- `project-cache.ts` - Project metadata cache (7-day TTL)
- `dsn-cache.ts` - DSN resolution cache
- `project-aliases.ts` - Short ID alias mappings
- `migration.ts` - One-time JSON to SQLite migration
- **SQLite configuration**:
- WAL mode for better concurrency
- 100ms busy timeout (fast fail for CLI responsiveness)
- Secure file permissions (0o600)
- **Node.js compatibility**: Added `bun:sqlite` → `node:sqlite` polyfill
for npm bundle
- **Backward compatible API**: Existing `src/lib/config.ts` re-exports
from new modules
## Migration
On first run after upgrade, the CLI automatically migrates data from
`config.json` to `cli.db` and deletes the old file.
Closes#76
0 commit comments