sqlc
sqlc copied to clipboard
Generate type-safe code from SQL
Hello, Is allowed to use unnest? ```sql INSERT INTO inventory(id, json_row, name) SELECT * FROM unnest(Array[48]::int[], ARRAY['{}']::json[], ARRAY['me']::varchar[]); ``` I have this error: > function unnest(unknown, unknown) does not exist...
In a nested sub-select from a single table, sqlc reports an ambiguous column reference even though the inner query is only from a single table. **Config: sqlc.yaml** ```yaml version: "1"...
### Version 1.14.0 ### What happened? batch.go will import "github.com/jackc/pgconn" without using it if you use `:execresult` and `:batchexec` in the same query.sql file ### Relevant log output _No response_...
### Version 1.14.0 ### What happened? After I noticed #1605 was added to 1.14 I ran the new version against our code, as I know there's a few `CHANGE COLUMN`...
### What do you want to change? For Go, sqlc will use a positional argument for a query if there's a single parameter. If there's more than one, it will...
### What do you want to change? ```sql -- name: ListAuthors :many SELECT * FROM authors ORDER BY $1 $2; ``` - Example 1: ```sql SELECT * FROM authors ORDER...
### Correct Behavior The following query: ```sql -- name: selectUserByUsername :one SELECT * FROM users WHERE LOWER(username) = $1 AND age = $2 LIMIT 1; ``` Generates this Go code:...
### Version 1.10.0 ### What happened? To be fair, this is less of a bug but more about "follow upstream" report 😄 [PostgreSQL 14 considers `CREATE OR REPLACE TRIGGER`](https://www.postgresql.org/docs/current/sql-createtrigger.html) a...
I have a table with BIGSERIAL ID: ``` CREATE TABLE datastore_index ( id BIGSERIAL PRIMARY KEY, key VARCHAR(1000) UNIQUE NOT NULL, size INT NOT NULL, created_at TIMESTAMPTZ NOT NULL );...
I am creating two distinct functions but sqlc (both v1.7.0 and v1.8.0) seems to think they are the same function! ```sql CREATE FUNCTION myfunction(text[], text[]) RETURNS real LANGUAGE plpgsql AS...