mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 09:09:19 +08:00
parent
54163a4146
commit
f8991082da
25
src/lib.rs
25
src/lib.rs
@ -160,7 +160,7 @@ macro_rules! params {
|
|||||||
$crate::NO_PARAMS
|
$crate::NO_PARAMS
|
||||||
};
|
};
|
||||||
($($param:expr),+ $(,)?) => {
|
($($param:expr),+ $(,)?) => {
|
||||||
&[$(&$param as &dyn $crate::ToSql),+]
|
&[$(&$param as &dyn $crate::ToSql),+] as &[&dyn $crate::ToSql]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1682,5 +1682,28 @@ mod test {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_params() {
|
||||||
|
let db = checked_memory_handle();
|
||||||
|
db.query_row(
|
||||||
|
"SELECT
|
||||||
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||||
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||||
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||||
|
?, ?, ?, ?;",
|
||||||
|
params![
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1,
|
||||||
|
],
|
||||||
|
|r| {
|
||||||
|
assert_eq!(1, r.get_unwrap::<_, i32>(0));
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user