Skip to content

OUTPUT/RETURNING Clause Support for Inserts/Updates/Deletes #133

@freakingawesome

Description

@freakingawesome

Is there any plan on supporting OUTPUT (SQL Server) or RETURNING (PostgresQL) clauses for mutations? This would, for example, allow me to fetch the GUIDs that were inserted:

Example in SQL Server Dialect that also includes the name as well just to show that it can be a full result set with multiple fields and rows:

CREATE TABLE #Foo ( ID UNIQUEIDENTIFIER, Name NVARCHAR(100) )

INSERT #Foo
OUTPUT INSERTED.ID, INSERTED.Name
VALUES (NEWID(), 'A'), (NEWID(), 'B'), (NEWID(), 'C')

Example output

ID Name
D5D898B0-DDB0-49DF-B57E-C43E95978274 A
43E82C23-BD3E-45E9-ADBD-F77264C9A795 B
E08C3E50-AC3A-42D9-BFA5-C86E360790AE C

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions