DbClient SQL Add Parameter #2219
Unanswered
paul-marquick
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All.
https://github.com/drogonframework/drogon/wiki/ENG-08-1-Database-DbClient#Execution-Interface
Using the Drogon DbClient is there a way to add parameters at runtime? Something similar to creating a DB command and then calling 'addParameter' function, x number of times to add the values.
What I'm hoping to do is filter on a several columns (unknown at compile time). UI could be a grid and a user might specify a number of filters, possibly involving one or more columns.
I can create the SQL string with parameter placeholders. However I don't know how to dynamically add the parameter data.
The DbClient.execSqlAsync method takes parameters for the sql query, success callback, exception callback and then a parameter for the sql parameters, Arguments &&...args. Is there some way to create the Arguments &&...args dynamically at runtime?
Many thanks
Paul.
Beta Was this translation helpful? Give feedback.
All reactions