Skip to content

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

Merged
ephys merged 3 commits into
mainfrom
ephys/repl-parser-fix
May 20, 2022
Merged

ephys merged 3 commits into
mainfrom
ephys/repl-parser-fix

Conversation

@ephys

@ephys ephys commented May 20, 2022 •

Copy link
Copy Markdown
Member

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 added the type: bug DEPRECATED: replace with the "bug" issue type label 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
Copy Markdown
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

Labels

released on @v7 type: bug DEPRECATED: replace with the "bug" issue type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants