Skip to content

Fix binding parameters at the end of query - #25

Open
DreamerIK wants to merge 1 commit into
Falseclock:masterfrom
DreamerIK:fix/bind-at-end-of-query
Open

DreamerIK wants to merge 1 commit into
Falseclock:masterfrom
DreamerIK:fix/bind-at-end-of-query

Conversation

@DreamerIK

Copy link
Copy Markdown

Problem

Именованые параметры в конце строки приводили к ошибке

Changes

Добавил фикс в регулярку

Testing

Добавлены тесты для этого случая

Pg::_replaceBind() required a trailing non-word character after the
placeholder, so a bind standing at the very end of the query was never
matched and was sent to PostgreSQL as is, failing with a syntax error
at or near ":".

Matching the end of the subject as an alternative to that character is
enough: :id is still not replaced inside :idAccount, but a placeholder
closing the query is replaced now, and so is a bind used twice whose
second occurrence closes the query.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants