mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-25 02:21:37 +08:00
Handle the case when there is no placeholder
This commit is contained in:
parent
fea3d1051f
commit
1e73859eb3
@ -48,7 +48,7 @@ fn try_bind(input: TokenStream) -> Result<TokenStream> {
|
|||||||
return Err(err.to_string());
|
return Err(err.to_string());
|
||||||
}
|
}
|
||||||
if info.count == 0 {
|
if info.count == 0 {
|
||||||
return Ok(input);
|
return Ok(TokenStream::new());
|
||||||
}
|
}
|
||||||
if info.count as usize != info.names.len() {
|
if info.count as usize != info.names.len() {
|
||||||
return Err("Mixing named and numbered parameters is not supported.".to_string());
|
return Err("Mixing named and numbered parameters is not supported.".to_string());
|
||||||
|
@ -20,6 +20,13 @@ fn test_literal() -> Result {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_no_placeholder() -> Result {
|
||||||
|
let _stmt = Stmt;
|
||||||
|
__bind!(_stmt "SELECT 1");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME
|
/* FIXME
|
||||||
#[test]
|
#[test]
|
||||||
fn test_raw_string() {
|
fn test_raw_string() {
|
||||||
|
Loading…
Reference in New Issue
Block a user