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
{{ message }}
Repository navigation
[FEATURE]: Support more DBMS' for OpenCode state storage #14212
Hi! It is also very useful on HPC environments (Slurm , LFS..) where HOME is on shared storage and users run opencode from multiple servers. We've run into corrupted database as file locks aren't reliable enough on NFS. The cleanest approach seems to use a remote database like postgresql. While theoretically drizzle makes it simple, there is a cost for maintainers if they plan on relying more into the sqlite ecosystem.
We can't persist sessions inside sandboxes due to not having remote db support. This leaves FUSE or rclone as the only few options for db persistence inside sandboxes such as Daytona or Cloudflare Sandbox, but both FUSE and rclone are not suitable for binary content such as sqlite.
Support for custom databases would be great such as Cloudflare Durable Objects.
Yeah, here I'm just looking to get it set up in my homelab for the family to use as a replacement for proprietary options, and the web interface is great, but for sure not being able to have a database contain the state breaks the traditional app structure, where state is best kept in flat files (that distributed filesystems are suited to manage) or in databases. I would love to see this in order to enable more stable deployments of this wonderful app.
Activity
github-actions commentedon Feb 19, 2026
This issue might be a duplicate of existing issues. Please check:
miararoy commentedon Mar 9, 2026
+1 on this, any thoughts from OC team?
arthur-flam commentedon Mar 11, 2026
Hi! It is also very useful on HPC environments (Slurm , LFS..) where HOME is on shared storage and users run opencode from multiple servers. We've run into corrupted database as file locks aren't reliable enough on NFS. The cleanest approach seems to use a remote database like postgresql. While theoretically drizzle makes it simple, there is a cost for maintainers if they plan on relying more into the sqlite ecosystem.
skymoore commentedon Apr 2, 2026
Please do this one guys!
drkaangunduz commentedon Apr 7, 2026
sqlite has issues, postgres support would be very nice
mingfang commentedon Apr 21, 2026
Can replace SQLite with pg0
https://github.com/vectorize-io/pg0
emretinaztepe commentedon May 10, 2026
We can't persist sessions inside sandboxes due to not having remote db support. This leaves FUSE or rclone as the only few options for db persistence inside sandboxes such as Daytona or Cloudflare Sandbox, but both FUSE and rclone are not suitable for binary content such as sqlite.
Support for custom databases would be great such as Cloudflare Durable Objects.
smacz42 commentedon May 17, 2026
Yeah, here I'm just looking to get it set up in my homelab for the family to use as a replacement for proprietary options, and the web interface is great, but for sure not being able to have a database contain the state breaks the traditional app structure, where state is best kept in flat files (that distributed filesystems are suited to manage) or in databases. I would love to see this in order to enable more stable deployments of this wonderful app.
tripersonale commentedon Jun 22, 2026
Hey, we built a working PostgreSQL backend and wanted to share in case it helps move this forward.
Approach:
Test suite:
Code: tripersonale/opencode branch feat/postgresql-backend (4 commits, no unrelated changes)
Happy to open a focused PR if this aligns with your roadmap. If you are already working on this, no worries — the fork works for us either way.
tripersonale commentedon Jun 23, 2026
Update (Jun 23, 2026): we forked properly and the feature branch is now at https://github.com/tripersonale/opencode/tree/feat/multi-database-backend
Changes: 18 commits, 33 files, +1621/-326 vs upstream
dev:Tested on PostgreSQL 18.4 with concurrent writer workloads. Upstream PR coming when the diff stabilizes.
smacz42 commentedon Jun 23, 2026
Looking forward to the PR - would love to see that land in upstream!
ainexxo-master commentedon Jul 2, 2026
jakiechris commentedon Jul 27, 2026
+1
AlexMKX commentedon Aug 13, 2026
I'd suggest check duckdb - it multithreaded and much faster than sqlite
github-actions commentedon Oct 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
smacz42 commentedon Oct 15, 2026
bummer