wwwouter / typed-knex

A TypeScript wrapper for Knex.js
MIT License
113 stars 13 forks source link

Added `selectRaw` string bindings; Added `orWhereParentheses` #62

Closed bgilman-nyk closed 2 years ago

bgilman-nyk commented 2 years ago

My project uses this package a ton, and we recently realized that one of our major calls was susceptible to sql injection. The culprit is an interpolated string being used in selectRaw. By adding knew.raw string bindings to the function, we can use knex's built-in sql injection handling.

I also added the orWhereParentheses implementation as not having this is preventing us from executing some complicated filtering logic

wwwouter commented 2 years ago

Looks good, thanks!