pub fn sql_query(i: &[u8]) -> IResult<&[u8], SqlQuery>
Examples found in repository?
More examples
examples/parse.rs (line 12)
4fn main() {
5 let sql = r#"
6CREATE TABLE `default`.`access` (
7 `remote_addr` String CODEC(ZSTD(1)),
8 `remote_addr_long` Int32
9) ENGINE = Distributed('cluster', '', 'access', rand());
10 "#.trim();
11
12 let (_rest, schema) = clickhouse_sql_parser::sql_query(sql.as_bytes()).unwrap();
13 println!("SQL statement: {}", schema);
14 dbg!(&schema);
15}