mirror of
https://github.com/isar/rusqlite.git
synced 2025-08-19 12:29:34 +08:00
Captured identifiers in SQL strings
Use `raw_bind_parameter`
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
use rusqlite_macros::__bind;
|
||||
|
||||
type Result = std::result::Result<(), String>;
|
||||
|
||||
struct Stmt;
|
||||
|
||||
impl Stmt {
|
||||
pub fn raw_bind_parameter(&mut self, one_based_col_index: usize, param: &str) -> Result {
|
||||
let (..) = (one_based_col_index, param);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_literal() {
|
||||
let stmt = ();
|
||||
__bind!(stmt, "SELECT $name");
|
||||
fn test_literal() -> Result {
|
||||
let first_name = "El";
|
||||
let last_name = "Barto";
|
||||
let mut stmt = Stmt;
|
||||
__bind!(stmt, "SELECT $first_name, $last_name");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/* FIXME
|
||||
@@ -19,4 +33,4 @@ fn test_const() {
|
||||
let stmt = ();
|
||||
__bind!((), SQL);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
Reference in New Issue
Block a user