Fall back to SQL formatting for non-PL/pgSQL bodies#11
Conversation
format_plpgsql errored on LANGUAGE sql function bodies (a bare SQL statement such as WITH … SELECT). When the PL/pgSQL parse has errors, try SQL formatting and use it if it parses cleanly; otherwise report the original PL/pgSQL syntax error. This lets callers that route all function bodies through format_plpgsql handle SQL-language functions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 19 minutes and 44 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
Summary
format_plpgsqlerrored onLANGUAGE sqlfunction bodies — a bare SQL statement such asWITH … SELECT …— because they aren't PL/pgSQL blocks. pglifecycle hit this oncheck_for_invalid_domains.When the PL/pgSQL parse has errors, try
format()(SQL) and return that if it parses cleanly; otherwise report the original PL/pgSQL syntax error. This lets callers that route all function bodies throughformat_plpgsqlhandle SQL-language functions, and only changes behavior in the previously-erroring case.Verification
sql_body_fallbackregression test; full suite + clippy green.check_for_invalid_domainsbody (aWITH … SELECTusingE'…'strings) now formats via this fallback.🤖 Generated with Claude Code