diff --git a/Cargo.toml b/Cargo.toml index 2d510a8..a9077c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "exasol" -version = "0.2.4" +version = "0.2.5" edition = "2021" authors = ["bobozaur"] description = "Exasol client library implemented in Rust." diff --git a/src/query.rs b/src/query.rs index ae4147e..766496e 100644 --- a/src/query.rs +++ b/src/query.rs @@ -171,7 +171,7 @@ where /// # let password = env::var("EXA_PASSWORD").unwrap(); /// # /// let mut exa_con = connect(&dsn, &schema, &user, &password).unwrap(); - /// let result = exa_con.execute("SELECT 1, 2 UNION ALL SELECT 1, 2;").unwrap(); + /// let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST LIMIT 1500;").unwrap(); /// /// if let QueryResult::ResultSet(result_set) = result { /// // Change the expected row type with the turbofish notation @@ -194,7 +194,7 @@ where total_rows_pos: self.total_rows_pos, chunk_rows_num: self.chunk_rows_num, chunk_rows_pos: self.chunk_rows_pos, - result_set_handle: self.result_set_handle, + result_set_handle: std::mem::take(&mut self.result_set_handle), columns: std::mem::take(&mut self.columns), data_iter: std::mem::replace(&mut self.data_iter, vec![].into_iter()), connection: Rc::clone(&self.connection), diff --git a/tests/basic.rs b/tests/basic.rs index 07c9538..f2ffebf 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -37,11 +37,12 @@ mod tests { let password = env::var("EXA_PASSWORD").unwrap(); let mut exa_con = connect(&dsn, &schema, &user, &password).unwrap(); - let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST;").unwrap(); + let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST LIMIT 2001;").unwrap(); - if let QueryResult::ResultSet(mut r) = result { - let x = r.next(); - println!("{:?}", x); + let result_set = ResultSet::try_from(result).unwrap().with_row_type::>(); + let result_set = result_set; + for row in result_set { + println!("{:?}", row.unwrap()); } use std::time::Instant;