sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Support RETURNING with :copyfrom

Open iiacoban42 opened this issue 1 month ago • 1 comments

What do you want to change?

Support RETURNING statement with :copyfrom

Example:

-- name: CreateSignalsAndReturnUuid :copyfrom
INSERT INTO metadata.signals (slug, name, description)
VALUES ($1, $2, $3) RETURNING uuid;

Table schema:

-- object: metadata.signals | type: TABLE --
-- DROP TABLE IF EXISTS metadata.signals CASCADE;
CREATE TABLE metadata.signals
(
    uuid                uuid          NOT NULL DEFAULT uuidv7(),
    slug                metadata.slug NOT NULL,
    name                text          NOT NULL,
    description         text          NOT NULL DEFAULT '',
);

Currently go generate returns :copyfrom is not compatible with RETURNING

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

No response

iiacoban42 avatar Oct 31 '25 12:10 iiacoban42

I'd like to help with this issue if that's ok. Is anyone already working on it, or may I take it?

cc @kyleconroy

rubensantoniorosa2704 avatar Nov 03 '25 19:11 rubensantoniorosa2704