Expand description
§sqlx-scylladb
A database driver for ScyllaDB to be used with the Rust sqlx framework.
Wrap the scylla-rust-driver using the sqlx interface.
§Basic Usage
ⓘ
use sqlx_scylladb::ScyllaDBPoolOptions;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let pool = ScyllaDBPoolOptions::new()
.max_connections(5)
.connect("scylladb://localhost/test")
.await?;
sqlx::query("INSERT INTO users(id, name) VALUES(?, ?)")
.bind(1)
.bind("Alice")
.execute(&pool)
.await?;
let (name,): (String,) = sqlx::query_as("SELECT name FROM users WHERE id = ?")
.bind(1)
.fetch_one(&pool)
.await?;
assert_eq!("Alice", name);
Ok(())
}
§Features
- Standard type binding and fetching.
- Support for user-defined type macros.
#[sqlx::test]
macro support.- Migration support using the
sqlx-scylladb
command-line tool. - TLS support.
Modules§
- any
- Runtime-generic database driver.
any
feature is required. - ext
- Re-exported external crates.
- macros
macros
feature is required.
Structs§
- ScyllaDB
- ScyllaDB database driver.
- ScyllaDB
Argument Buffer - An array of ScyllaDBArguments used during encoding.
- ScyllaDB
Arguments - Implementation of sqlx::Arguments for ScyllaDB.
- ScyllaDB
Column - Implementation of sqlx::Column for ScyllaDB.
- ScyllaDB
Connect Options - Options and flags which can be used to configure a ScyllaDB connection.
- ScyllaDB
Connection - Implementation of sqlx::Connection for ScyllaDB.
- ScyllaDB
Query Result - Query execution result.
- ScyllaDB
Row - Implementation of sqlx::Row for ScyllaDB.
- ScyllaDB
Statement - Implementation of sqlx::Statement for ScyllaDB.
- ScyllaDB
Transaction Manager - Implementation of [sqlx::TransactionManager] for ScyllaDB.
- ScyllaDB
Value - Implementation of sqlx::Value for ScyllaDB.
- ScyllaDB
Value Ref - Implementation of sqlx::ValueRef for ScyllaDB.
Enums§
- ScyllaDB
Argument - The enum of data types that can be handled by scylla-rust-driver.
- ScyllaDB
Compression - Compression methods.
- ScyllaDB
Error - Represents all the ways a method can fail within ScyllaDB.
- ScyllaDB
Replication Strategy - Replication strategy classes.
- ScyllaDB
Type Info - The enum for the supported type.
Traits§
- ScyllaDB
Executor - An alias for
sqlx::Executor<'_, Database = ScyllaDB>
. - ScyllaDB
HasArray Type - Provides information necessary to encode and decode ScyllaDB arrays as compatible Rust types.
- ScyllaDB
Type - An alias for
sqlx::Type<ScyllaDB>
.
Functions§
Type Aliases§
- ScyllaDB
Pool - An alias for sqlx::Pool, specialized for ScyllaDB.
- ScyllaDB
Pool Options - An alias for sqlx::pool::PoolOptions, specialized for ScyllaDB.
- ScyllaDB
Transaction - An alias for
sqlx::Transaction<'_, ScyllaDB>
.