We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0a2825 commit adadfe2Copy full SHA for adadfe2
src/sql/mod.rs
@@ -30,14 +30,16 @@ impl<'parts> SqlBuilder<'parts> {
30
let mut parts = Vec::new();
31
let mut rest = template;
32
while let Some(idx) = rest.find('?') {
33
- if idx != 0 {
+ if rest[idx + 1..].starts_with('?') {
34
+ parts.push(Part::Str(&rest[..idx + 1]));
35
+ rest = &rest[idx + 2..];
36
+ continue;
37
+ } else if idx != 0 {
38
parts.push(Part::Str(&rest[..idx]));
39
}
40
+
41
rest = &rest[idx + 1..];
- if let Some(restqq) = rest.strip_prefix('?') {
- parts.push(Part::Str("?"));
- rest = restqq;
- } else if let Some(restfields) = rest.strip_prefix("fields") {
42
+ if let Some(restfields) = rest.strip_prefix("fields") {
43
parts.push(Part::Fields);
44
rest = restfields;
45
} else {
0 commit comments