kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.22k stars 259 forks source link

[BUG] Extraneous Attributes allowed on `insertInto` when using `.map` to generate an array of values #913

Closed hughgardiner closed 5 months ago

hughgardiner commented 5 months ago

I'm writing a migration script from Mongo to Postgres and I've really enjoyed using Kysely for it so far!

However, I discovered that when trying to do bulk inserts via insertInto where the input is generated using .map on an array, Kysely is unable to validate against the inferred type from the return value of the .map callback

Playground Link

koskimas commented 5 months ago

Yep, there's nothing we can do about this.