pub async fn new_client() -> Result<GenericClient>
Expand description

Establishes a database client based on environment variables

Env

  • LIBSQL_CLIENT_URL - URL of the database endpoint - e.g. a https:// endpoint for remote connections (with specified credentials) or local file:/// path for a local database
  • (optional) LIBSQL_CLIENT_TOKEN - authentication token for the database. Skip if your database does not require authentication

Examples

let db = libsql_client::new_client().await.unwrap();