Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
Added ProtocolVersion to public API. Commented out the map-like test …
Browse files Browse the repository at this point in the history
…for PreparedStatement execute
  • Loading branch information
bobozaur committed Apr 2, 2022
1 parent ed41d0e commit 06ecb0d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pub mod query;
pub mod response;
pub mod row;

pub use crate::con_opts::ConOpts;
pub use crate::con_opts::{ConOpts, ProtocolVersion};
pub use crate::connection::{connect, Connection};
pub use crate::params::bind;
pub use crate::query::{PreparedStatement, QueryResult, ResultSet};
Expand Down
33 changes: 17 additions & 16 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ impl PreparedStatement {
///
/// let mut exa_con = connect(&dsn, &schema, &user, &password).unwrap();
/// let prep_stmt = exa_con.prepare("INSERT INTO EXA_RUST_TEST VALUES(?, ?, ?)").unwrap();
/// println!("{:?}", &prep_stmt);
///
/// let json_data = json!(
/// [
Expand All @@ -372,22 +373,22 @@ impl PreparedStatement {
/// ["e", "f", 3],
/// ]
/// );
///
/// prep_stmt.execute(json_data).unwrap();
///
/// #[derive(Serialize, Clone)]
/// #[serde(rename_all = "UPPERCASE")]
/// struct Data {
/// col1: String,
/// col2: String,
/// col3: u8
/// }
///
/// let data_item = Data { col1: "t".to_owned(), col2: "y".to_owned(), col3: 10 };
/// let vec_data = vec![data_item.clone(), data_item.clone(), data_item];
///
/// prep_stmt.execute(vec_data).unwrap();
///
/// #
/// # prep_stmt.execute(json_data.as_array().unwrap()).unwrap();
/// #
/// # #[derive(Serialize, Clone)]
/// # #[serde(rename_all = "UPPERCASE")]
/// # struct Data {
/// # col1: String,
/// # col2: String,
/// # col3: u8
/// # }
/// #
/// # let data_item = Data { col1: "t".to_owned(), col2: "y".to_owned(), col3: 10 };
/// # let vec_data = vec![data_item.clone(), data_item.clone(), data_item];
/// #
/// # // prep_stmt.execute(vec_data).unwrap();
/// #
/// ```
pub fn execute<T, S>(&self, data: T) -> Result<QueryResult>
where
Expand Down

0 comments on commit 06ecb0d

Please sign in to comment.