Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INSERT multiple sets optional boolean values to all null if first element is null #1015

Open
alicia-pika opened this issue Jan 21, 2025 · 0 comments

Comments

@alicia-pika
Copy link

alicia-pika commented Jan 21, 2025

const equipmentList = 
[{
    someKey: "value1",
    optionalBool: null
  },
  {
    someKey: "value2",
    optionalBool: true
  },
  {
    someKey: "value3",
    optionalBool: false
  }]

await sql`insert into equipment ${sql(listOfThings)}` 

Because we used implicit columns and the first element has a null value, the resulting db table winds up with all optionalBool values as null. If the first element has a boolean for optionalBool, the column is saved correctly.

Version 3.4.3

We've worked around it but thought I should report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant