Parameters are correctly passed and select expression completes successfully when sqlfn is used inside a fields alias within with.
Current behavior:
Executing such an expression throws exception PSQLException No value specified for parameter 1. org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet (SimpleParameterList.java:257)
Steps to reproduce
DB tables:
parent (id serial primary key, name varchar)
child (id serial primary key, parent int references parent(id), name varchar)
SELECT "child"."name" AS "child_name", COALESCE("parent"."name", ?) AS "parent_name" FROM "child" LEFT JOIN "parent" ON "parent"."id" = "child"."parent"
Expected behavior:
Parameters are correctly passed and
select
expression completes successfully whensqlfn
is used inside afields
alias withinwith
.Current behavior:
Executing such an expression throws exception
PSQLException No value specified for parameter 1. org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet (SimpleParameterList.java:257)
Steps to reproduce
DB tables:
Korma entities:
Korma expression to execute:
Generated SQL from this expression:
Notably, this works correctly:
Environment
Clojure 1.9.0 Korma 0.4.3 (org.clojure/java.jdbc 0.6.1) PostgreSQL 10.6