Expand description
§prax-cassandra
Apache Cassandra driver for Prax ORM using cdrs-tokio.
Provides async CRUD, prepared statements, batches, lightweight transactions, paging, virtual tables (Cassandra 4.0+), and UDF/UDA management.
§Example
use prax_cassandra::{CassandraConfig, CassandraPool};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = CassandraConfig::builder()
.known_nodes(["127.0.0.1:9042".to_string()])
.default_keyspace("myapp")
.build();
let pool = CassandraPool::connect(config).await?;
// ... use pool ...
Ok(())
}§Migration Support
Schema migrations use prax_migrate::CqlDialect, which works identically
for Cassandra and ScyllaDB since both use CQL.
Re-exports§
pub use auth::PlainSasl;pub use auth::SaslMechanism;pub use config::CassandraAuth;pub use config::CassandraConfig;pub use config::CassandraConfigBuilder;pub use config::Consistency;pub use config::RetryPolicyKind;pub use config::TlsConfig;pub use connection::CassandraConnection;pub use engine::BatchBuilder;pub use engine::CassandraEngine;pub use engine::QueryResult;pub use error::CassandraError;pub use error::CassandraResult;pub use pool::CassandraPool;pub use row::FromRow;pub use row::Row;pub use udf::UdaDefinition;pub use udf::UdfDefinition;pub use udf::UdfLanguage;pub use virtual_tables::ClusterInfo;pub use virtual_tables::PeerInfo;pub use virtual_tables::VirtualTables;
Modules§
- auth
- SASL authentication framework for Cassandra.
- config
- Configuration for a Cassandra connection.
- connection
- Connection wrapper around a cdrs-tokio Session.
- engine
- Query execution engine.
- error
- Error types for the prax-cassandra driver.
- pool
- Connection pool handle for a Cassandra cluster.
- row
- Row deserialization trait and helpers.
- row_ref
- Bridge between cdrs-tokio rows and
prax_query::row::RowRef. - types
- CQL type conversions to Rust types.
- udf
- User-defined function and aggregate management.
- virtual_
tables - Helpers for querying Cassandra 4.0+ virtual tables.