docs.rs failed to build sqlx-turso-driver-0.0.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
sqlx-turso-driver
An asynchronous SQLx driver for embedded Turso databases.
Features
- File-backed and in-memory databases.
- SQLx connection pools with acquire timeouts and configurable engine busy timeouts.
- Parameterized queries through
query,query_asandquery_scalar. - Integer, floating-point, string, binary, boolean and nullable values.
- Owned rows, column-name/index access, prepared statements and column metadata.
- Row streaming, optional/single-row fetches, result collections and affected-row counts.
- Transactions with commit, rollback and deferred cleanup on drop.
- File persistence across connection close and reopen.
Usage
Dependencies
With the driver checkout alongside your application, add:
[]
= { = "../sqlx-turso-driver" }
= { = "1", = ["macros", "rt-multi-thread"] }
Use the driver's re-exported sqlx for queries and connection traits.
File database, connection pool and transactions
use Duration;
use ;
async
Call tx.rollback().await? instead of tx.commit().await? to discard a transaction's changes.
In-memory database
use ;
use ;
async
For a pooled in-memory database, use connect_pool(TursoConnectOptions::memory(), 1).await?.
Run the example
The local example demonstrates parameter binding, commit, rollback and file close/reopen: