Closed supercoolspy closed 9 months ago
Also I'd be happy to do this just want to make sure there isn't any issues with the idea
Just wanted to throw this extra footnote in here for the Engineering team but it looks like we can re-build the Turso database connection pretty easily according to this example since the remote connect method allows for a URL and an auth token (just like with the libsql_client
crate): https://github.com/tursodatabase/libsql/blob/main/libsql/examples/example_v2.rs
Could you motivate further why libsql
would be the better choice? libsql_client
uses it internally for the "local backend" for local files. The latter is also more feature complete and is the recommended library to use.
https://github.com/libsql/libsql-client-rs/issues/52#issuecomment-1847968384 Just found this out, sorry for the late response
Looks good. We can't publish crates with git dependencies, so we need to wait until they publish theirs in order to support it.
Alright can 100% do this when it gets published
@jonaro00 @supercoolspy So I have been following Turso a bit and the new libsql crate has been published (https://crates.io/crates/libsql) and is now preferred.^1
At the time of writing, their documentation pages are not entirely up-to-date, so expect to see some references to the 'old' libsql-client (https://docs.turso.tech/sdk/rust/quickstart). But both the examples and crate docs are available. (https://github.com/tursodatabase/libsql/tree/main/libsql/examples, https://docs.rs/libsql/0.2.0/libsql/)
Awesome :D . Feel free to try it out in shuttle-turso and make a PR if it works well.
Awesome :D . Feel free to try it out in shuttle-turso and make a PR if it works well.
@jonaro00 I have a draft PR open which migrates to the new libsql crate https://github.com/shuttle-hq/shuttle/pull/1531 The changes on the shuttle side are pretty simple. There might be some changes to how database url's are handled, so I am waiting for a response by the shuttle team on that. Other than that, I feel that most is described in the PR itself. Being my first contribution I am not sure on how to properly test these changes (the unit tests succeed at least). What I can and plan to do is see how it works with a project of mine that makes use of shuttle and shuttle-turso.
I hope this contribution is useful and let me know what I might have missed!
Describe the feature
This allows users to use the more beta
libsql
crate as opposed to thelibsql_client
crate which has some nicer features along with being Send+Sync (Connection
at least)Suggestion or Example of how the feature would be used
Pass in a
libsql::Database
object instead of alibsql_client::Client
and then it would be availableDuplicate declaration