Skip to content

Add Turso backend#69

Merged
mattn merged 3 commits into
fiatjaf:masterfrom
mattn:turso
Jun 25, 2026
Merged

Add Turso backend#69
mattn merged 3 commits into
fiatjaf:masterfrom
mattn:turso

Conversation

@mattn

@mattn mattn commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a Turso (libsql) eventstore backend. It mirrors the SQLite backend but connects to a remote Turso database via the libsql driver, so it is remote-only (use the existing sqlite3 backend for local files). Includes a guarded test that runs against a real instance when TURSO_DATABASE_URL is set.

mattn added 2 commits June 25, 2026 01:51
The test pulled the libsql dependency into the test package, and the
test environment is not expected to have a Turso/libsql server available.
@mattn

mattn commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Removed the Turso test: it pulled the libsql dependency into the test package, and the CI/test environment isn't expected to have a Turso/libsql server to run against. The turso package itself still keeps the dependency for users who import it.

The libsql driver treats $N placeholders as named parameters, which do
not bind to the positional args passed by database/sql. The parameters
were dropped, so INSERT OR IGNORE ran with unbound (NULL) values, the
NOT NULL constraint violation was silently ignored, and SaveEvent
returned ErrDupEvent while storing nothing. Use ? placeholders instead.
@mattn mattn merged commit 8e40a49 into fiatjaf:master Jun 25, 2026
1 check passed
@mattn mattn deleted the turso branch June 25, 2026 14:42
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.

1 participant