Skip to content
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

fix: expand where $bind & :replacements can be used #14524

Merged
merged 3 commits into from May 20, 2022
Merged

Conversation

ephys
Copy link
Member

@ephys ephys commented May 20, 2022

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • Does yarn test or yarn test-DIALECT pass with this change (including linting)?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description Of Change

Ports #14518 to v7.
$bind parameters can be followed by ; but, unlike :replacements cannot be used inside of an array literal.

With this PR, these are all processed correctly:

SELECT * FROM users WHERE id = ARRAY[:id]::int[];
SELECT * FROM users WHERE id = ARRAY[?]::int[];
SELECT * FROM users WHERE id = :id;
SELECT * FROM users WHERE id = ?;
SELECT * FROM users WHERE id = $bind;

@ephys ephys self-assigned this May 20, 2022
@ephys ephys merged commit 87a6123 into main May 20, 2022
@ephys ephys deleted the ephys/repl-parser-fix branch May 20, 2022 16:28
@github-actions
Copy link
Contributor

🎉 This PR is included in version 7.0.0-alpha.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants