Was this page helpful?
Caution
You're viewing documentation for an unstable version of Scylla Rust Driver. Switch to the latest stable version.
Blob
is represented as Vec<u8>
use futures::TryStreamExt;
// Insert some blob into the table as a Vec<u8>
// We can insert it by reference to not move the whole blob
let to_insert: Vec<u8> = vec![1, 2, 3, 4, 5];
session
.query_unpaged("INSERT INTO keyspace.table (a) VALUES(?)", (&to_insert,))
.await?;
// Read blobs from the table
let mut iter = session.query_iter("SELECT a FROM keyspace.table", &[]).await?.into_typed::<(Vec<u8>,)>();
while let Some((blob_value,)) = iter.try_next().await? {
println!("{:?}", blob_value);
}
Was this page helpful?