Was this page helpful?
Caution
You're viewing documentation for an unstable version of Scylla Rust Driver. Switch to the latest stable version.
Uuid
is represented as uuid::Uuid
.
use futures::TryStreamExt;
use uuid::Uuid;
// Insert some uuid into the table
let to_insert: Uuid = Uuid::parse_str("8e14e760-7fa8-11eb-bc66-000000000001")?;
session
.query_unpaged("INSERT INTO keyspace.table (a) VALUES(?)", (to_insert,))
.await?;
// Read uuid from the table
let mut iter = session.query_iter("SELECT a FROM keyspace.table", &[])
.await?
.rows_stream::<(Uuid,)>()?;
while let Some((uuid_value,)) = iter.try_next().await? {
println!("{:?}", uuid_value);
}
Was this page helpful?