Commit 293165f
committed
Fix query-values priority
When used with an upsert clause, query-values was not being rendered
with the correct priority. The provided test fails on master and passes
on this branch. It was previously rendering the SQL as:
```
INSERT INTO distributors (did, dname)
ON CONFLICT ON CONSTRAINT distributors_pkey DO NOTHING
(SELECT ?, ?)
```
which is not valid SQL. The below snippet from psql demonstrates this
not working:
```
muncher=# insert into foo (id) select 1 on conflict do nothing;
INSERT 0 1
muncher=# insert into foo (id) on conflict do nothing (select 1);
ERROR: syntax error at or near "on"
LINE 1: insert into foo (id) on conflict do nothing (select 1);
```1 parent d45d510 commit 293165f
File tree
2 files changed
+10
-3
lines changed- src/honeysql_postgres
- test/honeysql_postgres
2 files changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
0 commit comments