Skip to content

Support RETURNING with :copyfrom #4165

@iiacoban42

Description

@iiacoban42

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions