bulk-insert with constant variable as one column
Hey, I'm basically trying to mirror https://stackoverflow.com/questions/6937442/in-postgres-is-it-possible-to-insert-a-constant-combined-with-the-result-of-sel. I can't figure out how I'd achieve this with Kysely.
I'm currently here:
but this doesn't quite work on the
select
statement, since Kysely/TS doesn't like the second argument.
Does anyone know how I could do a INSERT INTO ... SELECT ...
query, where one of the values I am SELECT
ing is a constant (in my case, insertedId
)?Solution:Jump to solution
<#1239624163682029690> Had me covered!
```ts
await trx
.insertInto("mapped_groups")
.columns(["group_id_fk", "mapped_id_fk"])...
1 Reply
Solution
<#1239624163682029690> Had me covered!