2022-11-21 01:07:17 +08:00
|
|
|
use rusqlite_macros::__bind;
|
|
|
|
|
2022-12-04 18:25:01 +08:00
|
|
|
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(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-21 01:07:17 +08:00
|
|
|
#[test]
|
2022-12-04 18:25:01 +08:00
|
|
|
fn test_literal() -> Result {
|
|
|
|
let first_name = "El";
|
|
|
|
let last_name = "Barto";
|
|
|
|
let mut stmt = Stmt;
|
2023-08-22 01:40:37 +08:00
|
|
|
__bind!(stmt "SELECT $first_name, $last_name");
|
2022-12-04 18:25:01 +08:00
|
|
|
Ok(())
|
2022-11-21 01:07:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME
|
|
|
|
#[test]
|
|
|
|
fn test_raw_string() {
|
|
|
|
let stmt = ();
|
2023-04-16 22:17:36 +08:00
|
|
|
__bind!(stmt r#"SELECT 1"#);
|
2022-11-21 01:07:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_const() {
|
|
|
|
const SQL: &str = "SELECT 1";
|
|
|
|
let stmt = ();
|
2023-04-16 22:17:36 +08:00
|
|
|
__bind!(stmt SQL);
|
2022-11-21 01:07:17 +08:00
|
|
|
}
|
2022-12-04 18:25:01 +08:00
|
|
|
*/
|