fix(postgresql): keep spaces around OPERATOR() with denseOperators#958
Conversation
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: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughIn ChangesOPERATOR() dense-operator spacing fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Also, I invited you to be a full-time collaborator. No pressure :) |
|
@sarathfrancis90 you should now have push access to the repository. |
I was trying out
denseOperatorson some Postgres queries and noticed it mangles theOPERATOR(schema.op)syntax:The spaces around the operator get stripped, so
fooruns into theOPERATORkeyword 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.