Skip to content

Fix FTS dumps and cross-thread pool reuse - #1

Merged
bendangelo merged 2 commits into
bendangelo:masterfrom
supermomonga:fix/fts-structure-dump
Aug 11, 2026
Merged

bendangelo merged 2 commits into
bendangelo:masterfrom
supermomonga:fix/fts-structure-dump

Conversation

@supermomonga

@supermomonga supermomonga commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • exclude Turso internal FTS indexes from SQL structure dumps
  • add an ngram FTS dump/load regression test
  • verify Japanese substring search after reloading the dumped schema
  • reconnect pooled Active Record connections when they are checked out by a different thread or fiber
  • add a pool-size-one regression test for sequential cross-thread connection reuse

Context

The turso Ruby driver binds a native connection to the thread and fiber that created it. Active Record may safely check a pooled adapter back in and later lend that same adapter to another execution context. Reopening only the native connection during the checkout callback preserves Active Record's pooling contract without sharing a native connection across threads or fibers.

Tests

  • bundle exec rake test (115 runs, 205 assertions)
  • bundle exec rake test:conformance (37 runs, 63 assertions)

@supermomonga supermomonga changed the title Fix FTS structure dump round trips Fix FTS dumps and cross-thread pool reuse Aug 5, 2026
@bendangelo
bendangelo marked this pull request as ready for review August 11, 2026 18:35
@bendangelo

Copy link
Copy Markdown
Owner

Thank you for your contribution.

@bendangelo
bendangelo merged commit b82a226 into bendangelo:master Aug 11, 2026
1 of 13 checks passed
@supermomonga

Copy link
Copy Markdown
Contributor Author

@bendangelo
Thanks! btw, sorry I forgot to make this PR from draft to ready 😅

@bendangelo

Copy link
Copy Markdown
Owner

No problem. I'm trying to test this out in a rails app but I've run into multiple issues, like the sqlite file staying locked. and that's preventing me from continuing work. I'm open to any other contributions.

@supermomonga

Copy link
Copy Markdown
Contributor Author

oops, are those issues caused by this PR?

Yes, I'm interested in contributing to this gem and turso gem.
When those gems are production ready, I want to switch from SQLite + Litestream to Turso Cloud in my Rails apps.

@bendangelo

Copy link
Copy Markdown
Owner

No those were not caused by you. The issue is with the turso rust code, it's something I cannot touch. I'll keep testing this on my end.

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