- Notifications
You must be signed in to change notification settings - Fork976
Design for inserting multiple rows#2385
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Heya. A recurring feature request (#2254,#2002 etc) is the ability to insert multiple rows at once. For PostgreSQL we have CopyFrom support, which works quite well - but COPY FROM can only INSERT, so you need to use a temp table if you want some form of updating. For MySQL I have PR#2220 pending, but MySQL's LOAD DATA LOCAL INFILE comes with a bunch of caveats that are scary. It is more powerful than Postgres's COPY FROM through, but I've yet to build support the LOAD DATA statement which actually allows using those features. So that still leaves us with a niche unfilled: A simple INSERT INTO with multiple rows. I've been looking into the design of it and ran into a few things I'd like to discuss.
|
BetaWas this translation helpful?Give feedback.
All reactions
👍 14👀 4
Replies: 4 comments 5 replies
-
Isn't the query just a regular |
BetaWas this translation helpful?Give feedback.
All reactions
-
@Jillie is talking about bulk inserts, which is not supported: |
BetaWas this translation helpful?Give feedback.
All reactions
-
Yeah, it's what I was referring to. As the generator could add support for |
BetaWas this translation helpful?Give feedback.
All reactions
-
Any traction on this issue? I recently ran into this exact problem with respect to sqlite. I have an unknown length of records that I would like to insert into my table and am currently just looping through to do the inserts. |
BetaWas this translation helpful?Give feedback.
All reactions
-
It can also be processed first using |
BetaWas this translation helpful?Give feedback.
All reactions
-
This is a pretty serious gap in functionality right now, forcing us to hand-code batch insertion code. I like the idea of …and the outer parameters are not useful to repeat. What if we could do this: This would be akin to a partial function that, for each |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
This method of using |
BetaWas this translation helpful?Give feedback.
All reactions
-
I spoke too soon. There is a bug preventing |
BetaWas this translation helpful?Give feedback.
All reactions
-
Also, |
BetaWas this translation helpful?Give feedback.