Replace BindParameter ? with $1 does not work in INSERT VALUES ?
See original GitHub issueSQLDelight Version
2.0.0-alpha04
Operating System
macOS
Gradle Version
7.5.1
Kotlin Version
1.7.20
Dialect
Postgresql
AGP Version
No response
Describe the Bug
While #3375 adds support to replace ?
to $1
in code generating, https://github.com/cashapp/sqldelight/pull/3375#discussion_r934996801, this does not work when sqldelight replaces a single ?
with multiple ?
in an insert statement:
insert:
INSERT INTO foo VALUES ?;
Results into: INSERT INTO foo VALUES (?, ?, ?)
, but should be: INSERT INTO foo VALUES ($1, $2, $3)
too.
Stacktrace
No response
Gradle Build Script
No response
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How to insert values using column name with space?
INSERT INTO table_name VALUES (:param_x, :param_y) will only work if the table is defined with column "x" followed by column "y". It won't...
Read more >SQLBindParameter Function - ODBC API Reference
This function replaces the ODBC 1.0 function SQLSetParam. ... All parameters in SQL statements that do not call procedures, such as INSERT ......
Read more >SQL Bind Variables/Parameters in Databases
When using bind parameters you do not write the actual values but instead insert placeholders into the SQL statement. That way the statements...
Read more >PDOStatement::bindParam - Manual - PHP
Example #1 Execute a prepared statement with named placeholders. <?php ... This can cause problems when trying to compare values using the ===...
Read more >5 Binding and Defining
If you change only the value of a bind variable, it is not necessary to rebind ... conversion. insert into t (c2) values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sachera I would suggest creating the PR and we can discuss it there.
Done: #3662