You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something like this test but with ["bar", "baz", "foo?bar"] ( with ? inside string)
#[test]
fn it_builds_sql_with_in_clause() {
fn t(arg: &[&str], expected: &str) {
let mut sql = SqlBuilder::new("SELECT ?fields FROM test WHERE a IN ?");
sql.bind_arg(arg);
sql.bind_fields::<Row>();
assert_eq!(sql.finish().unwrap(), expected);
}
const ARGS: &[&str] = &["bar", "baz", "foo?bar"];
t(&ARGS[..0], r"SELECT `a`,`b` FROM test WHERE a IN []");
t(&ARGS[..1], r"SELECT `a`,`b` FROM test WHERE a IN ['bar']");
t(
&ARGS[..2],
r"SELECT `a`,`b` FROM test WHERE a IN ['bar','baz']",
);
t(
ARGS,
r"SELECT `a`,`b` FROM test WHERE a IN ['bar','baz','foo?bar']",
);
}
unbound query argument: ?
thread 'sql::test::it_builds_sql_with_in_clause' panicked at 'unbound query argument: ?', clickhouse.rs/src/sql/mod.rs:69:21
stack backtrace:
0: std::panicking::begin_panic
at /home/f/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:519:12
1: clickhouse::sql::SqlBuilder::finish
at ./src/sql/mod.rs:69:21
2: clickhouse::sql::test::it_builds_sql_with_in_clause::t
at ./src/sql/mod.rs:116:24
3: clickhouse::sql::test::it_builds_sql_with_in_clause
at ./src/sql/mod.rs:126:9
4: clickhouse::sql::test::it_builds_sql_with_in_clause::{{closure}}
The text was updated successfully, but these errors were encountered:
Something like this test but with ["bar", "baz", "foo?bar"] ( with ? inside string)
The text was updated successfully, but these errors were encountered: