Skip to content

Conversation

@pschiel
Copy link
Contributor

@pschiel pschiel commented Jan 17, 2026

(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
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
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 6 times, most recently from 277ab15 to 0325e37 Compare January 17, 2026 09:34
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