1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#![allow(unknown_lints)]
#![warn(rust_2018_idioms)]
mod conn_ext;
mod each_chunk;
mod interrupt;
mod maybe_cached;
mod query_plan;
mod repeat;
pub use crate::conn_ext::*;
pub use crate::each_chunk::*;
pub use crate::interrupt::*;
pub use crate::maybe_cached::*;
pub use crate::query_plan::*;
pub use crate::repeat::*;
pub fn escape_string_for_pragma(s: &str) -> String {
s.replace("'", "''")
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_escape_string_for_pragma() {
assert_eq!(escape_string_for_pragma("foobar"), "foobar");
assert_eq!(escape_string_for_pragma("'foo'bar'"), "''foo''bar''");
assert_eq!(escape_string_for_pragma("''"), "''''");
}
}