Was this page helpful?
Caution
You're viewing documentation for an unstable version of Scylla Rust Driver. Switch to the latest stable version.
Duration
is represented as CqlDuration
\
use futures::TryStreamExt;
use scylla::frame::value::CqlDuration;
// Insert some duration into the table
let to_insert: CqlDuration = CqlDuration { months: 1, days: 2, nanoseconds: 3 };
session
.query_unpaged("INSERT INTO keyspace.table (a) VALUES(?)", (to_insert,))
.await?;
// Read duration from the table
let mut iter = session.query_iter("SELECT a FROM keyspace.table", &[])
.await?
.into_typed::<(CqlDuration,)>();
while let Some((duration_value,)) = iter.try_next().await? {
println!("{:?}", duration_value);
}
Was this page helpful?