-
-
Save cvybhu/23e5964a8daef57f8a5bd70651e6793d to your computer and use it in GitHub Desktop.
Print PreparedMetadata using the Rust driver for Scylla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scylla::{Session, SessionBuilder}; | |
#[tokio::main] | |
async fn main() { | |
let session: Session = SessionBuilder::new() | |
.known_node("127.0.0.1:9042") | |
.build() | |
.await | |
.unwrap(); | |
session | |
.query("DROP KEYSPACE IF EXISTS tks", ()) | |
.await | |
.unwrap(); | |
session.query("CREATE KEYSPACE tks with replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}", ()).await.unwrap(); | |
session | |
.query( | |
"CREATE TABLE tks.tab (p int, c int, PRIMARY KEY (p, c))", | |
(), | |
) | |
.await | |
.unwrap(); | |
let prepared = session | |
.prepare("SELECT p FROM tks.tab WHERE p = :x AND c = :x") | |
.await | |
.unwrap(); | |
println!("{:#?}", prepared.get_prepared_metadata()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment