SQLx is an async, pure Rust† SQL crate featuring compile-time checked queries without a DSL.
async-std / tokio / actix) and TLS backends (native-tls, rustls).† 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.
sqlx::Pool.sqlx::query), statements are prepared and cached per connection.Row types used by the high-level API. Supports batch execution and returns results from all statements.LISTEN and NOTIFY for PostgreSQL.Any database driver for changing the database driver at runtime. An AnyPool connects to the driver indicated by the URL scheme.SQLx is compatible with the async-std, tokio, and actix runtimes; and, the native-tls and rustls TLS backends. When adding the dependency, you must choose a runtime feature that is runtime + tls.
# Cargo.toml
[dependencies]
# PICK ONE OF THE FOLLOWING:
# tokio (no TLS)
sqlx = { version = "0.8", features = [ "runtime-tokio" ] }
# tokio + native-tls
sqlx = { version = "0.8", features = [ "runtime-tokio", "tls-native-tls" ] }
# tokio + rustls with ring and WebPKI CA certificates
sqlx = { version = "0.8", features = [ "runtime-tokio", "tls-rustls-ring-webpki" ] }
# tokio + rustls with ring and platform's native CA certificates
sqlx = { version = "0.8", features = [ "runtime-tokio", "tls-rustls-ring-native-roots" ] }
# tokio + rustls with aws-lc-rs
sqlx = { version = "0.8", features = [ "runtime-tokio", "tls-rustls-aws-lc-rs" ] }
# async-std (no TLS)
sqlx = { version = "0.8", features = [ "runtime-async-std" ] }
# async-std + native-tls
sqlx = { version = "0.8", features = [ "runtime-async-std", "tls-native-tls" ] }
# async-std + rustls with ring and WebPKI CA certificates
sqlx = { version = "0.8", features = [ "runtime-async-std", "tls-rustls-ring-webpki" ] }
# async-std + rustls with ring and platform's native CA certificates
sqlx = { version = "0.8", features = [ "runtime-async-std", "tls-rustls-ring-native-roots" ] }
# async-std + rustls with aws-lc-rs
sqlx = { version = "0.8", features = [ "runtime-async-std", "tls-rustls-aws-lc-rs" ] } For more information click here.
Microsoft has officially unveiled its latest gaming venture, Project Helix, a next-generation gaming console set…
In the digital era, an email address can reveal much more than just a contact…
Mr.Holmes is an OSINT (Open Source Intelligence) tool designed to gather valuable information from public…
WhatWeb is the perfect name for this tool. It answers the question, “What is that…
In an era dominated by messaging apps, WhatsApp has become a key platform for personal…
Imagine if you had a super-powered assistant who could automatically handle all the boring, repetitive…