Question: Named bindings #1654
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
I have a situation where I have some pretty complex raw queries that are being constructed. To avoid dealing with escaping values myself, I'd like to let the query builder handle this. Additionally, because the queries are complex and constructed in many steps, I'd rather not have the ordering of the replacements be significant. In many other tools, I would use "named bindings" to do this, but I can't find any example of this in the docs.
For example, something like
runQuery('SELECT * FROM mytable WHERE foo = :fooval', { fooval: 'value to use in the query' })
Knex mentions this here as "named bindings", but I can't seem to find the right way to get access to this method, as the TS type for
queryBuilder.raw()
only accepts a single string.The text was updated successfully, but these errors were encountered: