deepkit-framework icon indicating copy to clipboard operation
deepkit-framework copied to clipboard

fix(sql): fix queries where value legitimately begins with $

Open fergusean opened this issue 1 year ago • 0 comments

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:

  • [X] 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.

fergusean avatar Jun 21 '24 22:06 fergusean