-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: initial implementation of a libsql driver #79
base: main
Are you sure you want to change the base?
Conversation
I didn't see the multi-thread error locally... will investigate |
Thanks for the PR. What are the pros / cons of libsql vs sqlite? |
So libsql primarily shines in a couple bigger places;
If you want Turso's argument, their README lists a few more features it adds over plain SQLite, and their 'manifesto' provides the motivation behind building it. |
Also, r.e. this:
I think I might implement |
Okay @carllerche I think I've figured out what breaks this... Apparently running I'm not entirely sure how to resolve this in the context of Would you be okay with me splitting the test command to do |
This PR aims to implement #78 by introducing a new
toasty-libsql
driver, supportinglibsql
.It uses a lot of carbon-copy code from the
rusqlite
implementation, as minimal changes are needed to port between SQLite APIs and LibSQL by design.Outstanding things to check/implement;
libsql::Database
isSync
, butlibsql::Connection
is. However, this means we have one connection for the entire driver instance. I don't want to go as far as opening one connection per execution, but I'd like to look into some method of pooling the connections at some point.Token authentication to a LibSQL service needs a second parameter, but I don't know how to pass it just yet. I think some string manipulating/including the token in a query param then taking that parameter and passing it as the token might work.Implementing this viaimpl From<libsql::Connection> for LibSQL
in the driver crate.usize
toi32
in the code for the driver, but I have no idea if that's sensible in the slightest; if there's a more 'safe' way to implement that type conversion I'd be very appreciative, but for now it got the code running.The new driver currently works properly with all the example codebases, running them with
--features libsql
and settingTOASTY_CONNECTION_URL
tolibsql::memory:
succeeds without any errors.Let me know if I'm barking up the right tree here or not! :)