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
Implementing .whereLike and .whereILike api #4457
Conversation
Thank you! Could you also please add some integration tests that actually retrieve some data? see |
@@ -479,6 +479,22 @@ class QueryCompiler_MSSQL extends QueryCompiler { | |||
} | |||
return offset; | |||
} | |||
|
|||
whereLike(statement) { | |||
return `[${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this need some escaping for variables? I think for columns we typically use formatter.columnize
, and for a single value client.parameter
. See C:\sources\node\knex\lib\query\querycompiler.js
for an example.
@@ -218,6 +218,18 @@ class QueryCompiler_PG extends QueryCompiler { | |||
distinctOn(value) { | |||
return 'distinct on (' + this.formatter.columnize(value) + ') '; | |||
} | |||
|
|||
whereLike(statement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need client-specific implementations of this functions if we use standard knex escaping mechanism? I assume there are no other differences?
I can finish this PR. Can you add me to collaborators on this branch @LucasHFS ? |
Superseded by #4779 |
Attempt to solve #2265 .