Skip to content

Comments

Add libsql persistence plugin#9355

Open
kyranmcdonnell wants to merge 1 commit intotemporalio:mainfrom
kyranmcdonnell:feat/libsql-persistence-plugin
Open

Add libsql persistence plugin#9355
kyranmcdonnell wants to merge 1 commit intotemporalio:mainfrom
kyranmcdonnell:feat/libsql-persistence-plugin

Conversation

@kyranmcdonnell
Copy link

Turso is basically SQLite under the hood, so this is a straightforward extension: same schema, same config shape, just swap in go-libsql instead of modernc.org/sqlite. When they ship multithreading it could be a drop-in performance boost for anyone using SQLite today.

Couple of fixes that came up:

  • DQS=0 — libsql treats double-quoted strings as identifiers. Our visibility schema uses "$.Foo" in generated columns and was failing. Plugin rewrites those to single-quoted when applying schema.
  • Dup detection — go-libsql has no typed errors, so we match on SQLite codes 2067/1555 and the error string.

Requires CGO. Config: pluginName: "libsql", databaseName is a file path or :memory:. Example in config/development-libsql.yaml.

SQL plugin using go-libsql (CGO) instead of modernc.org/sqlite. Same
schema, same config shape, same behaviour.

Differences from the sqlite plugin:
- Requires CGO_ENABLED=1
- No typed errors from go-libsql; IsDupEntryError matches extended
  codes 2067/1555 with a string fallback
- DSN is file: path or :memory: only (no pragma params)
- libsql ships with DQS=0, so double-quoted strings in DDL are
  identifiers. The visibility schema uses double-quoted JSON paths in
  generated columns — normalizeDQS rewrites them to single-quoted in
  CREATE/ALTER so the schema applies correctly.

Config: pluginName "libsql", databaseName file path or :memory:.
@kyranmcdonnell kyranmcdonnell requested review from a team as code owners February 19, 2026 06:00
@CLAassistant
Copy link

CLAassistant commented Feb 19, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants