Deprecate `Database.bulk_insert`
The following discussion from !25590 (merged) should be addressed:
-
@mkaeppler started a discussion: (+1 comment) We need to have a discussion about how to migrate to the new API, since there is no consistency currently about how we perform bulk inserts. Note that this MR is based on ActiveRecord 6's new
InsertAll
type, which btw I found to work better than our hand-rolledDatabase.bulk_insert
(I ran into errors when using that function in imports), but I have not actually checked whether they cover the same functionality.
A suggestion for how to approach this:
-
MR0:
- Mark all methods that require migration as deprecated first. We had used
Kernel.warn
to do this earlier, which turned out to be quite noisy as these will show up in tests as well, so we reverted this in !26440 (merged) for now, so we should consider other options (aCop
maybe?)
- Mark all methods that require migration as deprecated first. We had used
-
MR[1..N]:
- Migrate over a single deprecated call
- Remove the respective deprecation note
-
MR[N+1]:
- Drop
Database.bulk_insert
method* - If necessary, remove any documentation and other references to it
- Drop
*this might depend on whether the new APIs cover existing functionalit completeley
Edited by Matthias Käppler