SQLite: Allow dollar signs in placeholder names (#1620)

This commit is contained in:
Hans Ott 2024-12-28 14:20:48 +01:00 committed by GitHub
parent d0d4153137
commit 48f025f658
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 53 additions and 4 deletions

View file

@ -561,6 +561,16 @@ fn test_dollar_identifier_as_placeholder() {
}
_ => unreachable!(),
}
// $$ is a valid placeholder in SQLite
match sqlite().verified_expr("id = $$") {
Expr::BinaryOp { op, left, right } => {
assert_eq!(op, BinaryOperator::Eq);
assert_eq!(left, Box::new(Expr::Identifier(Ident::new("id"))));
assert_eq!(right, Box::new(Expr::Value(Placeholder("$$".to_string()))));
}
_ => unreachable!(),
}
}
fn sqlite() -> TestedDialects {