Captured identifiers in SQL strings

Use `raw_bind_parameter`
This commit is contained in:
gwenn
2022-12-04 11:25:01 +01:00
parent cc23f9cdd7
commit 5b20201423
3 changed files with 42 additions and 10 deletions

View File

@@ -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);
}
*/
*/