Skip to content

Array indexes not correctly handled on update set #1532

Closed
@stephanievance29

Description

@stephanievance29

I have a SQL query in my project that is attempting to update an array at a specific index but it is not being handled correctly. I was able to replicate this issue in a separate project and pasted the sample query below.

-- name: UpdateRow :one
update temp
set places[$1] = $2
where id=$3
RETURNING *;

The generated code treats places[$1] as an array input parameter instead of accepting $1 as the index of the places column.

Playground

https://play.sqlc.dev/p/a7c1a274a647d8c2452f4bc9cd93f8a76bf09c43745ea428859433edec18aaa1

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