shssoichiro / sqlformat-rs

SQL Formatter written in Rust
Apache License 2.0
89 stars 26 forks source link

Posgresql: Incorrect intentation for one-byte character literal #25

Closed andreoss closed 2 months ago

andreoss commented 1 year ago

PostgreSQL provides a special syntax for a one-byte character E'<char>' sqlformat puts space after E which is incorrect

$ echo "SELECT 'new line -> '||E'\n';" | sleek                                                                                                                              
SELECT                                                                                                                                                                       
    'new line -> ' || E '\n';
wugeer commented 2 months ago

@andreoss Hello, this issue has been fixed in the unreleased version. You can wait for the new version to be released, then update the sqlformat package to the latest version in sleek and try again. :)

image

andreoss commented 2 months ago

Thanks