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

Implementing .whereLike and .whereILike api #4457

Closed
wants to merge 3 commits into from
Closed

Implementing .whereLike and .whereILike api #4457

wants to merge 3 commits into from

Conversation

LucasHFS
Copy link
Contributor

Attempt to solve #2265 .

@kibertoad
Copy link
Collaborator

Thank you! Could you also please add some integration tests that actually retrieve some data? see integration2 directory for good examples.

@@ -479,6 +479,22 @@ class QueryCompiler_MSSQL extends QueryCompiler {
}
return offset;
}

whereLike(statement) {
return `[${
Copy link
Collaborator

@kibertoad kibertoad Apr 28, 2021

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) {
Copy link
Collaborator

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?

@OlivierCavadenti
Copy link
Collaborator

I can finish this PR. Can you add me to collaborators on this branch @LucasHFS ?

@OlivierCavadenti
Copy link
Collaborator

Superseded by #4779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants