mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 11:31:37 +08:00
Rename query_named_row -> query_row_named.
I think this is more consistent with Rust's tendency to group similar methods like `iter`, `iter_mut` by appending the difference as a suffix.
This commit is contained in:
parent
8d4b3e6a31
commit
186cb5893b
@ -38,7 +38,7 @@ impl SqliteConnection {
|
|||||||
///
|
///
|
||||||
/// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
|
/// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
|
||||||
/// underlying SQLite call fails.
|
/// underlying SQLite call fails.
|
||||||
pub fn query_named_row<T, F>(&self,
|
pub fn query_row_named<T, F>(&self,
|
||||||
sql: &str,
|
sql: &str,
|
||||||
params: &[(&str, &ToSql)],
|
params: &[(&str, &ToSql)],
|
||||||
f: F)
|
f: F)
|
||||||
@ -183,7 +183,7 @@ mod test {
|
|||||||
1);
|
1);
|
||||||
|
|
||||||
assert_eq!(3i32,
|
assert_eq!(3i32,
|
||||||
db.query_named_row("SELECT SUM(x) FROM foo WHERE x > :x",
|
db.query_row_named("SELECT SUM(x) FROM foo WHERE x > :x",
|
||||||
&[(":x", &0i32)],
|
&[(":x", &0i32)],
|
||||||
|r| r.get(0))
|
|r| r.get(0))
|
||||||
.unwrap());
|
.unwrap());
|
||||||
@ -200,7 +200,7 @@ mod test {
|
|||||||
stmt.execute_named(&[(":name", &"one")]).unwrap();
|
stmt.execute_named(&[(":name", &"one")]).unwrap();
|
||||||
|
|
||||||
assert_eq!(1i32,
|
assert_eq!(1i32,
|
||||||
db.query_named_row("SELECT COUNT(*) FROM test WHERE name = :name",
|
db.query_row_named("SELECT COUNT(*) FROM test WHERE name = :name",
|
||||||
&[(":name", &"one")],
|
&[(":name", &"one")],
|
||||||
|r| r.get(0))
|
|r| r.get(0))
|
||||||
.unwrap());
|
.unwrap());
|
||||||
|
Loading…
Reference in New Issue
Block a user