(1)) as t(x)")
[debug] QUERY OK db=0.5ms queue=0.8ms idle=1544.5ms
select * from (values (1)) as t(x) []
%Postgrex.Result{
columns: ["x"],
command: :select,
connection_id: 144,
messages: [],
num_rows: 1,
rows: [[1]]
}
А это — нет.
iex(3)> Repo.query!("select * from (values (?)) as t(x)", [1])
[debug] QUERY ERROR db=0.0ms queue=1.2ms idle=1831.2ms
select * from (values (?)) as t(x) [1]
** (Postgrex.Error) ERROR 42601 (syntax_error) syntax error at or near ")"
query: select * from (values (?)) as t(x)
(ecto_sql 3.7.1) lib/ecto/adapters/sql.ex:760: Ecto.Adapters.SQL.raise_sql_call_error/1
ЧЯДНТ?
А с чего ты решил, что ? работает?
Обсуждают сегодня