Was this page helpful?
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?