From 4644d9fe74c3c0602824e460fd0252c9082ecf5c Mon Sep 17 00:00:00 2001 From: Nick Sippl-Swezey Date: Mon, 16 Oct 2023 19:41:57 -0700 Subject: [PATCH] Update broken examples --- examples/compare-tokens.rs | 8 ++++---- examples/custom_deserialization.rs | 8 ++++---- examples/execution_profile.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/compare-tokens.rs b/examples/compare-tokens.rs index 5c56aa5f4d..9b2c18b7d7 100644 --- a/examples/compare-tokens.rs +++ b/examples/compare-tokens.rs @@ -17,16 +17,16 @@ async fn main() -> Result<()> { session .query( - "CREATE TABLE IF NOT EXISTS ks.t (pk bigint primary key)", + "CREATE TABLE IF NOT EXISTS ks.compare_tokens_example (pk bigint primary key)", &[], ) .await?; - let prepared = session.prepare("INSERT INTO ks.t (pk) VALUES (?)").await?; + let prepared = session.prepare("INSERT INTO ks.compare_tokens_example (pk) VALUES (?)").await?; for pk in (0..100_i64).chain(99840..99936_i64) { session - .query("INSERT INTO ks.t (pk) VALUES (?)", (pk,)) + .query("INSERT INTO ks.compare_tokens_example (pk) VALUES (?)", (pk,)) .await?; let serialized_pk = (pk,).serialized()?.into_owned(); @@ -43,7 +43,7 @@ async fn main() -> Result<()> { ); let qt = session - .query(format!("SELECT token(pk) FROM ks.t where pk = {}", pk), &[]) + .query(format!("SELECT token(pk) FROM ks.compare_tokens_example where pk = {}", pk), &[]) .await? .rows .unwrap() diff --git a/examples/custom_deserialization.rs b/examples/custom_deserialization.rs index 122c842bb8..88b7b72d6f 100644 --- a/examples/custom_deserialization.rs +++ b/examples/custom_deserialization.rs @@ -16,13 +16,13 @@ async fn main() -> Result<()> { session.query("CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}", &[]).await?; session .query( - "CREATE TABLE IF NOT EXISTS ks.t (pk int PRIMARY KEY, v text)", + "CREATE TABLE IF NOT EXISTS ks.custom_deserialization_test (pk int primary key, v text)", &[], ) .await?; session - .query("INSERT INTO ks.t (pk, v) VALUES (1, 'asdf')", ()) + .query("INSERT INTO ks.custom_deserialization_test (pk, v) VALUES (1, 'asdf')", ()) .await?; // You can implement FromCqlVal for your own types @@ -38,7 +38,7 @@ async fn main() -> Result<()> { } let (v,) = session - .query("SELECT v FROM ks.t WHERE pk = 1", ()) + .query("SELECT v FROM ks.custom_deserialization_test WHERE pk = 1", ()) .await? .single_row_typed::<(MyType,)>()?; assert_eq!(v, MyType("asdf".to_owned())); @@ -62,7 +62,7 @@ async fn main() -> Result<()> { impl_from_cql_value_from_method!(MyOtherType, into_my_other_type); let (v,) = session - .query("SELECT v FROM ks.t WHERE pk = 1", ()) + .query("SELECT v FROM ks.custom_deserialization_test WHERE pk = 1", ()) .await? .single_row_typed::<(MyOtherType,)>()?; assert_eq!(v, MyOtherType("asdf".to_owned())); diff --git a/examples/execution_profile.rs b/examples/execution_profile.rs index d8d1b1eed9..13bb44e0e6 100644 --- a/examples/execution_profile.rs +++ b/examples/execution_profile.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { println!("Connecting to {} ...", uri); let profile1 = ExecutionProfile::builder() - .consistency(Consistency::EachQuorum) + .consistency(Consistency::LocalQuorum) .serial_consistency(Some(SerialConsistency::Serial)) .request_timeout(Some(Duration::from_secs(42))) .load_balancing_policy(Arc::new(load_balancing::DefaultPolicy::default()))