I believe there is currently no way to perform a batch insert that returns generated values, due to the fact that insertStreaming uses the COPY API. This is great except for cases where the generated values are required by the application. Running a series of plain inserts wrapped in a ConnectionIO.sequence performs far worse than a single insert ... values ... statement.
upsertBatch is close in terms of API shape but doesn't quite work for this case because doesn't accept an Unsaved row.
I believe there is currently no way to perform a batch insert that returns generated values, due to the fact that
insertStreaminguses theCOPYAPI. This is great except for cases where the generated values are required by the application. Running a series of plaininserts wrapped in aConnectionIO.sequenceperforms far worse than a singleinsert ... values ...statement.upsertBatchis close in terms of API shape but doesn't quite work for this case because doesn't accept anUnsavedrow.