Rename execute_() to execute_with_bound_parameters().

This commit is contained in:
John Gallagher 2017-03-08 11:11:05 -05:00
parent 723fc91a09
commit 59159fcb25
2 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ impl<'conn> Statement<'conn> {
/// which case `query` should be used instead), or the underling SQLite call fails. /// which case `query` should be used instead), or the underling SQLite call fails.
pub fn execute_named(&mut self, params: &[(&str, &ToSql)]) -> Result<c_int> { pub fn execute_named(&mut self, params: &[(&str, &ToSql)]) -> Result<c_int> {
try!(self.bind_parameters_named(params)); try!(self.bind_parameters_named(params));
self.execute_() self.execute_with_bound_parameters()
} }
/// Execute the prepared statement with named parameter(s), returning a handle for the /// Execute the prepared statement with named parameter(s), returning a handle for the

View File

@ -76,7 +76,7 @@ impl<'conn> Statement<'conn> {
/// which case `query` should be used instead), or the underling SQLite call fails. /// which case `query` should be used instead), or the underling SQLite call fails.
pub fn execute(&mut self, params: &[&ToSql]) -> Result<c_int> { pub fn execute(&mut self, params: &[&ToSql]) -> Result<c_int> {
try!(self.bind_parameters(params)); try!(self.bind_parameters(params));
self.execute_() self.execute_with_bound_parameters()
} }
/// Execute the prepared statement, returning a handle to the resulting rows. /// Execute the prepared statement, returning a handle to the resulting rows.
@ -229,7 +229,7 @@ impl<'conn> Drop for Statement<'conn> {
// once pub(crate) is stable. // once pub(crate) is stable.
pub trait StatementCrateImpl<'conn> { pub trait StatementCrateImpl<'conn> {
fn new(conn: &'conn Connection, stmt: RawStatement) -> Self; fn new(conn: &'conn Connection, stmt: RawStatement) -> Self;
fn execute_(&mut self) -> Result<c_int>; fn execute_with_bound_parameters(&mut self) -> Result<c_int>;
fn bind_parameter(&self, param: &ToSql, col: c_int) -> Result<()>; fn bind_parameter(&self, param: &ToSql, col: c_int) -> Result<()>;
fn bind_parameter_index(&self, name: &CStr) -> Option<c_int>; fn bind_parameter_index(&self, name: &CStr) -> Option<c_int>;
fn last_insert_rowid(&self) -> i64; fn last_insert_rowid(&self) -> i64;
@ -246,7 +246,7 @@ impl<'conn> StatementCrateImpl<'conn> for Statement<'conn> {
} }
} }
fn execute_(&mut self) -> Result<c_int> { fn execute_with_bound_parameters(&mut self) -> Result<c_int> {
let r = self.stmt.step(); let r = self.stmt.step();
self.stmt.reset(); self.stmt.reset();
match r { match r {