How to insert many rows with one-to-many relationships

I have 100+ rows I want to insert into an artists table, and at the same time insert each artist's songs into a songs table. Each song would be linked to the artist ID, but the artist ID would be generated by the query itself. Any way to accomplish this with Drizzle? Basically, I have data like this I want to insert:
[
{
artist: "example",
songs: [
{ title: "A" },
// ...
]
},
// ...
]
[
{
artist: "example",
songs: [
{ title: "A" },
// ...
]
},
// ...
]
2 Replies
bloberenober
bloberenober14mo ago
you'd have to insert to different tables separately, same as how you'd do it with SQL
Kasper
Kasper14mo ago
I see, that's unfortunate - thanks!