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(sql): fix queries where value legitimately begins with $ #580

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

fergusean
Copy link
Contributor

Summary of changes

There are legitimate cases where a value may begin with $, and the current reference implementation breaks those cases. Example case, I have a query that looks for duplicate products named $100 Gift Card. This should result in:

WHERE `products`.`name` = ?

but it instead translates into:

WHERE `products`.`name` = `products`.`100 GC`

This PR introduces a new SqlReference class that can be used for cases where a reference is actually desired.

I only see a single usage case in the Deepkit source, and it's in the tests. It's unclear how many Deepkit users this may impact, but I do think it's important to fix.

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

@marcj marcj merged commit e0a0c3f into deepkit:master Aug 11, 2024
6 checks passed
@marcj
Copy link
Member

marcj commented Aug 11, 2024

thanks @fergusean

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.

None yet

2 participants