Tech News
← Back to articles

SQLx – Rust SQL Toolkit

read original related products more articles

SQLx

🧰 The Rust SQL Toolkit

SQLx is an async, pure Rust † SQL crate featuring compile-time checked queries without a DSL.

† The SQLite driver uses the libsqlite3 C library as SQLite is an embedded database (the only way we could be pure Rust for SQLite is by porting all of SQLite to Rust).

†† SQLx uses #![forbid(unsafe_code)] unless the sqlite feature is enabled. The SQLite driver directly invokes the SQLite3 API via libsqlite3-sys , which requires unsafe .

Cross-platform. Being native Rust, SQLx will compile anywhere Rust is supported.

Built-in connection pooling with sqlx::Pool .

Row streaming. Data is read asynchronously from the database and decoded on demand.

Automatic statement preparation and caching. When using the high-level query API ( sqlx::query ), statements are prepared and cached per connection.

Simple (unprepared) query execution including fetching results into the same Row types used by the high-level API. Supports batch execution and returns results from all statements.

... continue reading