You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knex has a nice named bindings option, which allows to use :parametersWithColon (see docs), which in turn are supported in RDBMS editors, so we don't have to replace all ${id} with :id manually each time we're testing raw SQL
The check that named parameters are present looks pretty straightforward
How about adding something similar to sql-template-strings, so we would be able to build queries like this i.e.
sql`SELECT * FROM books WHERE id = :bookId`.bind({ bookId })
The text was updated successfully, but these errors were encountered:
Really, if you want to use that kind of syntax, you're better off using the underlying database adapter directly, most of which already support that syntax. JS telmplate strings only naturally support the ordinal position, and your suggestion really wouldn't add much in terms of support. Also, not all the database backends currently in place support named parameters vs ordinal position.
Hello
Thanks for the awesome library
Knex has a nice named bindings option, which allows to use
:parametersWithColon
(see docs), which in turn are supported in RDBMS editors, so we don't have to replace all${id}
with:id
manually each time we're testing raw SQLThe check that named parameters are present looks pretty straightforward
How about adding something similar to
sql-template-strings
, so we would be able to build queries like this i.e.The text was updated successfully, but these errors were encountered: