Open ichbinallen opened 5 years ago
Fully agreed, but parameters are currently handled solely by libpq.
The canonical issue is https://github.com/r-dbi/DBI/issues/52. I think we need to preprocess the SQL ourselves (via sqlParseVariables()
and friends) and from that recompose a SQL with a named parameter syntax that matches the expectations of the driver. I'm more than happy to provide further guidance if you're still interested to tackle this issue.
Rewriting queries is out of scope for DBI, we need to make do with the parameter syntax that the database or DB driver provides.
Is it possible for RPostgres to support the use of named parameters rather than only positional parameters in parameterized queries? This is currently possible in RSQLite and might be beneficial in RPostgres as well.
For instance, perhaps the
named_parameterized_statement
is possible:I don't have the best development skills, but I would be willing to work on this if a more senior developer could confirm that this would be useful and give me some rough guidance.