-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FORMATTING] Formatter inserts space in between ^@
operator, making the SQL invalid
#734
Comments
Thanks for reporting. Looks like Additionaly, don't use |
Fixed in v15.3.1 |
TIL about the Seems like documentation around it is hard to locate, but you can confirm existence of it in => SELECT oprname, oprleft::regtype, oprright::regtype, oprresult::regtype, oprcode::regproc FROM pg_operator WHERE oprname = '^@';
oprname | oprleft | oprright | oprresult | oprcode
---------+---------+----------+-----------+-------------
^@ | text | text | boolean | starts_with
(1 row) Simple example query: => SELECT 'example' ^@ 'ex';
?column?
----------
t
(1 row) |
Awesome! The docs are here btw: https://www.postgresql.org/docs/15/functions-string.html#:~:text=text-,%5E%40,-text%20%E2%86%92%20boolean |
I'm not using the VS Code extension, but the |
That one should be fine :) You should be even able to upgrade the sql-formatter lib and have this plugin pick up the latest version. Or you could send a dependency update PR to that plugin repo. |
Input data
Which SQL and options did you provide as input?
Expected Output
Actual Output
which breaks the SQL with
The
^@
operator is equivalent tostarts_with()
, butstarts_with
cannot be used as a workaround when usingANY
.Usage
prettier-plugin-sql
The text was updated successfully, but these errors were encountered: