Was this page helpful?
Caution
You're viewing documentation for an unstable 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 scylla::IntoTypedRows;
use scylla::frame::value::Counter;
// Read counter from the table
if let Some(rows) = session.query("SELECT c FROM keyspace.table", &[]).await?.rows {
for row in rows.into_typed::<(Counter,)>() {
let (counter_value,): (Counter,) = row?;
let counter_int_value: i64 = counter_value.0;
}
}
Was this page helpful?