Skip to content

Empty array should probably produce invalid sql and throw #525

@RyanDurk

Description

@RyanDurk

The sql call below returns an empty array to the rows variable. I'm not sure how the query is being translated exactly (is there a way to see the generated query?) but I think throwing would be more useful than gracefully returning an empty array.

const arr = []
const rows = await sql`select *
		from generate_series(1, 5) i
		where i not in ${sql(arr)};`

  await sql.end()
  console.log(rows)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions