Closed d9k closed 3 years ago
This is tremendously hard to get correct. Postgres does not support this. @mbalmer I recommend closing as wontfix
@daurnimator, to do it right we need to parse postgresql query to syntax tree and there are some ways to do it:
https://wiki.postgresql.org/wiki/Query_Parsing
I agree that it's an advanced functionality beyond the purpose of luapgsql library
@daurnimator, @mbalmer, but php has named arguments support in pdo statements for many years. http://php.net/manual/en/pdo.prepared-statements.php
Or is their solution lack reliability too?
Or is their solution lack reliability too?
Correct. To use the named parameters, PDO emulates prepared statements client side. This uses their general SQL parser pdo_parse_params
, which doesn't understand all postgres statements.
As daurnimator recommends, we won't do this.
(for readability)
see https://github.com/brianc/node-postgres/issues/268