| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
With denseOperators the PostgreSQL OPERATOR(schema.op) construct was densed into its operands, e.g. "foo OPERATOR(public.===) bar" became "fooOPERATOR(public.===)bar", which re-parses as invalid SQL. It's a keyword-like operator, so it now keeps its surrounding spaces like the dashed "-" case does.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 105fb65e-d750-4518-97d8-8f9f3e1efafd 📥 CommitsReviewing files that changed from the base of the PR and between a9528c9 and 32a6520. 📒 Files selected for processing (2)
📝 Walkthrough Summary by CodeRabbit
WalkthroughIn ExpressionFormatter.formatOperator, a regex check for OPERATOR\s*\( is added to force surrounding spaces for PostgreSQL's OPERATOR(schema.+)-style operators, bypassing denseOperators behavior. A regression test verifies both OPERATOR(public.===) and OPERATOR(+) retain spaces under denseOperators: true. ChangesOPERATOR() dense-operator spacing fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4 ✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Great. Thanks.
Sorry, something went wrong.
|
Also, I invited you to be a full-time collaborator. No pressure :) |
Sorry, something went wrong.
|
@sarathfrancis90 you should now have push access to the repository. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I was trying out denseOperators on some Postgres queries and noticed it mangles the OPERATOR(schema.op) syntax:
format('SELECT foo OPERATOR(public.===) bar;', { language: 'postgresql', denseOperators: true }) // => // SELECT // fooOPERATOR(public.===)bar;The spaces around the operator get stripped, so foo runs into the OPERATOR keyword and the result no longer parses. Unlike +/=/etc., this one is keyword-like and can't be glued to its operands, so I made it keep its surrounding spaces even in dense mode — same idea as the existing - exception for dialects with dashed identifiers.
Added a test under the existing OPERATOR() case in postgresql.test.ts.