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

Allow named bindings to be escaped. #1576

Merged
merged 2 commits into from Jul 19, 2016
Merged

Allow named bindings to be escaped. #1576

merged 2 commits into from Jul 19, 2016

Conversation

@trevorsmith
Copy link
Contributor

@trevorsmith trevorsmith commented Jul 13, 2016

This PR extends escaping to named parameter bindings.

knex.select('*').from('users').whereRaw(":property: = '\\:value' OR \\:property: = :value", {
  property: 'name',
  value: 'Bob'
})

Outputs:

select * from `users` where `name` = ':value' OR :property: = 'Bob'

I've included tests and updated the documentation as well.

@elhigu
Copy link
Member

@elhigu elhigu commented Jul 19, 2016

Looks good to me 👍 Thanks

@elhigu elhigu merged commit b1a95b1 into knex:master Jul 19, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants