Closed
Description
Hello,
I am writing an invoicing application which has required me to create a query builder for user searches on the database. Since I cannot know beforehand how many conditions a user will supply, my WHERE
clauses must be written to a String
before generating an sqlx::query
from it. This means that my WHERE
clauses are vulnerable to SQLi as you cannot bind
to a String
.
Thus, in order to use this query builder safely, I would need one of two things:
Query::push
for mutableQuery
instances, so that I can add more to aQuery
and thenbind
my arguments.String::bind
(given theDatabase
) so I can generate my string first and then callsqlx::query
.
There may be another way around this that I am not thinking of, but in reading the docs I couldn't see how to either bind
without a Query
, nor amend a Query
once formed.
I see that bind
is very dependent on the ArgumentBuffer
s, so perhaps Query::push
would be easier?
Thank you for reading this!
Metadata
Metadata
Assignees
Labels
No labels