sqlc
sqlc copied to clipboard
Generate type-safe code from SQL
Fixes https://github.com/sqlc-dev/sqlc/issues/2983 The incorrectly generated code in this issue is generated as follows. ```go const listAuthorsWithCTE = `-- name: ListAuthorsWithCTE :many WITH page AS (SELECT id FROM authors WHERE authors.created_at...
### Version 1.25.0 ### What happened? I am trying to set a custom struct tag but its not generated with the model. ### Relevant log output ```shell // Code generated...
According to https://dev.mysql.com/doc/refman/8.0/en/locking-functions.html, certain locking functions can return NULL, e.g. RELEASE_LOCK(str) returns it if the named lock did not exist.
### What do you want to change? I have the following setup: queries.sql ```sql -- name: CheckDatabase :exec SELECT COUNT(ID), COUNT(Destination), COUNT(Hits), COUNT(Owner) FROM redirections; ``` schema.sql ```sql CREATE TABLE...
I propose adding type annotations for query parameters. Users will no longer need to cast parameters to the desired type. This proposal builds on Andrew's query annotation work for `vet`....
### Version 1.25.0 ### What happened? I have a query containing a `GROUP BY` clause, which uses [`ANY_VALUE`](https://www.postgresql.org/docs/16/functions-aggregate.html) (postgres v16+) to select any non-null value from a grouping, since (in...
### What do you want to change? MariaDB 10.5.0 has added INSERT INTO .. RETURNING like PostgreSQL supports. https://mariadb.com/kb/en/insertreturning/ DELETE .. RETURNING is also supported, but UPDATE .. RETURNING not...
### Version 1.25.0 ### What happened? It seems that the parser cannot identify the relation created from the cte when the cte is inside a subquery ### Relevant log output...
### Version 1.23.0 ### What happened? When using `sqlc.embed` on something in combination with a `LEFT JOIN`, meaning that the embedded table may be null, sqlc fails to parse the...