Was this page helpful?
Caution
You're viewing documentation for a deprecated version of Scylla Rust Driver. Switch to the latest stable version.
Counter
is represented as struct Counter(pub i64)
Counter
can’t be inserted, it can only be read or updated.
use futures::TryStreamExt;
use scylla::frame::value::Counter;
// Read counter from the table
let mut iter = session.query_iter("SELECT c FROM keyspace.table", &[])
.await?
.into_typed::<(Counter,)>();
while let Some((counter_value,)) = iter.try_next().await? {
let counter_int_value: i64 = counter_value.0;
println!("{}", counter_int_value);
}
Was this page helpful?