Repository navigation
Commit c42104e
committed
fix(duckdb): rewrite sqlc.arg and @name to native placeholders
The preprocess dialect table had no entry for DuckDB, and an engine with
no entry gets its source back unchanged. sqlc.arg(), sqlc.narg() and
@name then reached the analyzer as function calls and column names.
Add a DuckDB entry that uses $1 placeholders.
Reject sqlc.slice for this dialect. With $1 placeholders the generated Go
still calls strings.Replace on a "?" marker that the SQL does not
contain, so it binds only the first element of the list and returns wrong
rows without an error. A list parameter (list_contains or ANY) is the
DuckDB way to do this.
Adds the duckdb_named_params and analyze_slice_rejected cases.1 parent 3ad8b20 commit c42104e
14 files changed
Lines changed: 220 additions & 0 deletions
File tree
- internal
- endtoend/testdata
- analyze_slice_rejected/duckdb
- duckdb_named_params/duckdb
- go
- sql/preprocess
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments