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

Conversation

Projects
None yet
2 participants
@trevorsmith
Contributor

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

This comment has been minimized.

Collaborator

elhigu commented Jul 19, 2016

Looks good to me 👍 Thanks

@elhigu elhigu merged commit b1a95b1 into tgriesser:master Jul 19, 2016

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