Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libSQL Store support #1

Merged
merged 13 commits into from
Oct 1, 2023
Merged

Add libSQL Store support #1

merged 13 commits into from
Oct 1, 2023

Conversation

lukasschwab
Copy link
Owner

@lukasschwab lukasschwab commented Oct 1, 2023

The new store supports local sqlite file-databases — probably a more efficient alternative to my homebrewed store.File — and hosted databases by Turso.

  • Upgrades to Go 1.21.
  • Adds test coverage for that new store.
  • Adds cmd/migrate for migrating between tiir stores; see ea8cec4 message.

To do

The prepared SQL statements here are MySQL specific, and the Golang
MySQL driver I'm using (though seemingly fairly official) leaves a lot
to be desired.

Benchmark needs to be modified: each time we run the benchmark, we need
to generate a *fresh* store (out of timer) so that the times will
converge.
Why bad? Testing an in-memory SQL driver isn't really fair; it's unclear
how performant it is vs. actual MySQL. Moreover, dynamics in practice
are a little different: if a store is being loaded to serve the request,
the whole file has to be parsed; in this test, the file is parsed once
and then overwritten. That might also explain why the file perf doesn't
scale with initial file size: I should close and reopen it.

Anyway, the store benchmark concept was interesting; I learned something
here.
Could also consider e.g. a Turso store, but the supported SQL syntax is
slightly different (SQLite).
Tested with a local file.

The "connection-string" name is long and clumsy, and maybe specifically
correct for Postgres; "URL" feels too confusing. Maybe a "db" argument?
I doubt I'll add support for another DB anytime soon.
This doesn't strictly obviate cmd/tir/cmd/migrate, which was designed to
move TIR records from an HTML file (old form) into a tiir store. That's
still relevant, but it's unnecessarily messy if your texts are already
in a store.

I'll consider consolidating.
@lukasschwab lukasschwab changed the title Add libsql store support Add libSQL Store support Oct 1, 2023
@lukasschwab lukasschwab merged commit 255ebbd into main Oct 1, 2023
2 checks passed
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