This repository has been archived by the owner on Nov 9, 2021. It is now read-only.
Added toParam() for use with e.g. node-postgres' parameterized queries #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've done some initial work on adding a toParam() function that produces a { text: '', values: [] } object for use with for example node-postgres' parameterized queries.
I've included tests for my changes, although I'm not familiar enough with the project to ensure complete coverage. I also changed the WhereBlock tests slightly because neither parameterized where's nor IN was being tested.
Documentation still needs to be done, but I didn't feel that was useful before discussing the functionality itself.
I still have to actually test this with node-postgres, but I'd love some feedback on this, that's why the pull-request already.
I haven't programmed CoffeeScript before, so there might be some javascript-isms in there, please feel free to point those out as well.