Skip to content

question: how to dynamically return a column list (returning)?  #317

@fessacchiotto

Description

@fessacchiotto

hi! sorry if i overlooked this in the documentation.
is it possible to do something like this:

const a = 100
const columns = ['a', 'b', 'c']
sql`
   update table set a=${a} returning ${columns}
`

i tried using the sql helper and array joined string but without luck.
tia

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions