opencode
opencode copied to clipboard
feat: refactor storage into storage interface, add sqlite storage provider
(WIP)
Proposal: use Storage Interface (re: sqlite topic)
- refactor
Storageinto using aStorageProvider.Interface - move JSON logic into
JsonStorageProvider - add
SqliteStorageProvider - extend signature of
list()withorderByandlimit(so providers can take advantage of index/sorting) - configurable schema, allowing to
extractcertain (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 initto create new db -
opencode sqlite importto import json storage into sqlite - set
storage.backendtosqliteinopencode.jsonconfig