You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating code for an SQL query against a table with fields marked as UNSIGNED, the query arguments should also be unsigned. The currently generated code for the query relies on signed types, which is not the desired behavior.
In the case presented below, the following code is generated:
CREATETABLEIF NOT EXISTS `mappings` (
`id`BIGINT(20) UNSIGNED NOT NULL,
`left_id`BIGINT(20) UNSIGNED NOT NULL,
`right_id`BIGINT(20) UNSIGNED NOT NULL,
PRIMARY KEY (`left_id`, `right_id`),
UNIQUE INDEX `id_UNIQUE` (`id`ASC) VISIBLE,
INDEX `fk_left_id_idx` (`left_id`ASC) VISIBLE,
INDEX `fk_right_id_idx` (`right_id`ASC) VISIBLE
);
SQL queries
-- name: UpsertMapping :execINSERT INTO
mappings (left_id, right_id)
VALUES
(?, ?)
ON DUPLICATE KEY UPDATE
id = id;
Version
Other
What happened?
sqlc version:
1.19.0
When generating code for an SQL query against a table with fields marked as
UNSIGNED
, the query arguments should also be unsigned. The currently generated code for the query relies on signed types, which is not the desired behavior.In the case presented below, the following code is generated:
The expected and correct result should be:
Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/6316120fffa5029678410f26691f24670d912069e1345473c95c1f0d6825db6a
What operating system are you using?
Linux
What database engines are you using?
MySQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: