tursodatabase / libsql-client-rs

libSQL Rust client library can be used to communicate with sqld natively over HTTP protocol with native Rust interface.
MIT License
75 stars 27 forks source link

Possibly outdated libsql Rust SDK documentation. #50

Closed JustLeif closed 11 months ago

JustLeif commented 11 months ago

Hello! Currently trying out Turso for a new personal project and ran into a little bit of a blocker.

After installing the libsql-client crate with default feature flags, (0.32.0) image

I checked with the official Turso documentation:

use libsql_client::{new_client_from_config, Config, DatabaseClient};

let client = new_client_from_config(Config {
    url: "libsql://your-database.turso.io".try_into()?,
    auth_token: Some(String::from("your-auth-token")),
})
.await?;

new_client_from_config() & DatabaseClient both were not in the crate with default feature flags.

On this Github repositories README, I found:

let db = libsql_client::reqwest::Client::from_env()?;
let response = db
    .execute("SELECT * FROM table WHERE key = 'key1'")
    .await?;
    (...)

The reqwest::Client module was not found.

After investigating doc.rs, I was able to find the correct implementation.

Not sure if any Turso developers are checking these issues, but having that documentation up to date for 0.32.0 would have helped me a lot I think.

I am super excited to use Turso though, ThePrimeagen strongly recommended this service...

psarna commented 11 months ago

Thanks for reporting, I'll update https://github.com/tursodatabase/turso-docs