Was this page helpful?
Varint
is represented as num_bigint::BigInt
use scylla::IntoTypedRows;
use num_bigint::BigInt;
use std::str::FromStr;
// Insert a varint into the table
let to_insert: BigInt = BigInt::from_str("12345")?;
session
.query("INSERT INTO keyspace.table (a) VALUES(?)", (to_insert,))
.await?;
// Read a varint from the table
if let Some(rows) = session.query("SELECT a FROM keyspace.table", &[]).await?.rows {
for row in rows.into_typed::<(BigInt,)>() {
let (varint_value,): (BigInt,) = row?;
}
}
Was this page helpful?