Skip to content

Add support for RETURNING #1724

Closed
Closed
@Elara6331

Description

@Elara6331

Version

Other

What happened?

I've been trying out the new beta sqlite support using the main branch of sqlc, and it seems to work perfectly for the most part, but the RETURNING statement doesn't work.

Relevant log output

extraneous input 'RETURNING' expecting {<EOF>, ';', ALTER_, ANALYZE_, ATTACH_, BEGIN_, COMMIT_, CREATE_, DEFAULT_, DELETE_, DETACH_, DROP_, END_, EXPLAIN_, INSERT_, PRAGMA_, REINDEX_, RELEASE_, REPLACE_, ROLLBACK_, SAVEPOINT_, SELECT_, UPDATE_, VACUUM_, VALUES_, WITH_}

Database schema

CREATE TABLE users (name text, id serial primary key);

SQL queries

-- name: InsertUser :one
INSERT INTO users (name) VALUES (?) RETURNING id;

-- name: UpdateUser :one
UPDATE users SET name = ?
  RETURNING id;

-- name: DeleteUser :one
DELETE FROM users
  WHERE name = ?
  RETURNING id;

Configuration

No response

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

No response

What type of code are you generating?

Go

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