[PR #9012] feat: refactor storage into storage interface, add sqlite storage provider #12953

Closed
opened 2026-02-16 18:17:50 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9012

State: closed
Merged: No


(WIP)

Proposal: use Storage Interface (re: sqlite topic)

  • refactor Storage into using a StorageProvider.Interface
  • move JSON logic into JsonStorageProvider
  • add SqliteStorageProvider
  • extend signature of list() with orderBy and limit (so providers can take advantage of index/sorting)
  • configurable schema, allowing to extract certain (nested) keys from the data blob into separate columns
  • sqlite command/util to export/import from/to JSON

Effect

  • 100% backwards compatible - can switch storage via config
  • open for more storage engines
  • eliminate discussion about schema of preference

Migration steps

  • opencode sqlite init to create new db
  • opencode sqlite import to import json storage into sqlite
  • set storage.backend to sqlite in opencode.json config
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9012 **State:** closed **Merged:** No --- (WIP) ## Proposal: use Storage Interface (re: sqlite topic) - refactor `Storage` into using a `StorageProvider.Interface` - move JSON logic into `JsonStorageProvider` - add `SqliteStorageProvider` - extend signature of `list()` with `orderBy` and `limit` (so providers can take advantage of index/sorting) - configurable schema, allowing to `extract` certain (nested) keys from the data blob into separate columns - sqlite command/util to export/import from/to JSON ## Effect - 100% backwards compatible - can switch storage via config - open for more storage engines - eliminate discussion about schema of preference ## Migration steps - `opencode sqlite init` to create new db - `opencode sqlite import` to import json storage into sqlite - set `storage.backend` to `sqlite` in `opencode.json` config
yindo added the pull-request label 2026-02-16 18:17:50 -05:00
yindo closed this issue 2026-02-16 18:17:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12953