Skip to content

feat: refactor storage into storage interface, add sqlite storage provider - #9012

Closed
pschiel wants to merge 1 commit into
anomalyco:devfrom
pschiel:storage-interface
Closed

pschiel wants to merge 1 commit into
anomalyco:devfrom
pschiel:storage-interface

Conversation

@pschiel

@pschiel pschiel commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

(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

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@pschiel
pschiel force-pushed the storage-interface branch 7 times, most recently from 9c24f61 to 3c82fe8 Compare January 18, 2026 00:01
@pschiel pschiel closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant