Closed bartlomieju closed 5 days ago
I'm somewhat confused here, when I tried adding a test in the repo:
#[test]
fn it_formats_double_colons_in_where() {
let input = "select * from users where created_at > now() - '1 week'::interval";
let options = FormatOptions {
uppercase: Some(false),
..FormatOptions::default()
};
let expected = indoc!(
"
select
*
from
users
where
created_at > now() - '1 week'::interval"
);
assert_eq!(format(input, &QueryParams::None, &options), expected);
}
It passes fine, however when using sqlformat-rs
as a library with the repro in the issue I do get whitespace around ::
. It appears this has been already fixed on main
but not yet released, so 0.3.1 suffers from this problem.
Ah yes, looks like it was already fixed in https://github.com/shssoichiro/sqlformat-rs/pull/63. So just need to wait on a release :)
This results in:
but I expected that I would get: