Hacker News new | ask | show | jobs
by Dx5IQ 420 days ago
Such library functions tend to also accept a string as a valid input. E.g. db.execute from the GP usually works with strings to allow non-parametrized SQL queries.
2 comments

> Such library functions tend to also accept a string as a valid input.

Also? They tend only to accept a string (possibly with some additional arguments, if there is an in-library way to handle parameterization) as input, because Template literally hasn't been an option. New APIs designed with Template available will look different.

The library should just refuse strings. If a non parametrized query is desired, it could require the user to supply a t-string with no {}.