Skip to content

Commit

Permalink
Cassandra 5 functions (#1474)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Kent <[email protected]>
  • Loading branch information
conorbros and rukai authored Feb 14, 2024
1 parent 17f394d commit 5443175
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
9 changes: 7 additions & 2 deletions shotover-proxy/tests/cassandra_int_tests/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ async fn drop_function(session: &CassandraConnection) {
async fn create_function(session: &CassandraConnection) {
run_query(
session,
"CREATE FUNCTION test_function_keyspace.my_function (a int, b int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE javascript AS 'a * b';"
).await;
"CREATE FUNCTION test_function_keyspace.my_function (a int, b int)
RETURNS NULL ON NULL INPUT
RETURNS int
LANGUAGE java
AS $$ return a * b; $$;",
)
.await;

assert_query_result(
session,
Expand Down
28 changes: 4 additions & 24 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,19 +1021,9 @@ async fn cassandra_5(#[case] driver: CassandraDriver) {
.start()
.await;

let connection_creator = || CassandraConnectionBuilder::new("127.0.0.1", 9042, driver).build();

let connection = connection_creator().await;
let connection = || CassandraConnectionBuilder::new("127.0.0.1", 9042, driver).build();

keyspace::test(&connection).await;
table::test(&connection).await;
udt::test(&connection).await;
native_types::test(&connection).await;
collections::test(&connection, driver).await;
prepared_statements_simple::test(&connection, connection_creator, 1).await;
prepared_statements_all::test(&connection, 1).await;
batch_statements::test(&connection).await;
timestamp::test(&connection).await;
standard_test_suite(&connection, driver).await;

shotover.shutdown_and_then_consume_events(&[]).await;
}
Expand All @@ -1047,7 +1037,7 @@ async fn cassandra_5_cluster(#[case] driver: CassandraDriver) {
.start()
.await;

let connection_creator = || async {
let connection = || async {
let mut connection = CassandraConnectionBuilder::new("127.0.0.1", 9042, driver)
.build()
.await;
Expand All @@ -1057,17 +1047,7 @@ async fn cassandra_5_cluster(#[case] driver: CassandraDriver) {
connection
};

let connection = connection_creator().await;

keyspace::test(&connection).await;
table::test(&connection).await;
udt::test(&connection).await;
native_types::test(&connection).await;
collections::test(&connection, driver).await;
prepared_statements_simple::test(&connection, connection_creator, 1).await;
prepared_statements_all::test(&connection, 1).await;
batch_statements::test(&connection).await;
timestamp::test(&connection).await;
standard_test_suite(&connection, driver).await;

shotover.shutdown_and_then_consume_events(&[]).await;
}

0 comments on commit 5443175

Please sign in to comment.