mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 11:31:37 +08:00
Rename bind_named_parameters -> bind_parameters_named.
This commit is contained in:
parent
0051ff47a6
commit
599e30f372
@ -88,7 +88,7 @@ impl<'conn> SqliteStatement<'conn> {
|
|||||||
/// Will return `Err` if binding parameters fails, the executed statement returns rows (in
|
/// Will return `Err` if binding parameters fails, the executed statement returns rows (in
|
||||||
/// 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)]) -> SqliteResult<c_int> {
|
pub fn execute_named(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<c_int> {
|
||||||
try!(self.bind_named_parameters(params));
|
try!(self.bind_parameters_named(params));
|
||||||
unsafe {
|
unsafe {
|
||||||
self.execute_()
|
self.execute_()
|
||||||
}
|
}
|
||||||
@ -118,13 +118,13 @@ impl<'conn> SqliteStatement<'conn> {
|
|||||||
params: &[(&str, &ToSql)])
|
params: &[(&str, &ToSql)])
|
||||||
-> SqliteResult<SqliteRows<'a>> {
|
-> SqliteResult<SqliteRows<'a>> {
|
||||||
self.reset_if_needed();
|
self.reset_if_needed();
|
||||||
try!(self.bind_named_parameters(params));
|
try!(self.bind_parameters_named(params));
|
||||||
|
|
||||||
self.needs_reset = true;
|
self.needs_reset = true;
|
||||||
Ok(SqliteRows::new(self))
|
Ok(SqliteRows::new(self))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bind_named_parameters(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<()> {
|
fn bind_parameters_named(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<()> {
|
||||||
// Always check that the number of parameters is correct.
|
// Always check that the number of parameters is correct.
|
||||||
assert!(params.len() as c_int == unsafe { ffi::sqlite3_bind_parameter_count(self.stmt) },
|
assert!(params.len() as c_int == unsafe { ffi::sqlite3_bind_parameter_count(self.stmt) },
|
||||||
"incorrect number of parameters to query(): expected {}, got {}",
|
"incorrect number of parameters to query(): expected {}, got {}",
|
||||||
|
Loading…
Reference in New Issue
Block a user