Skip to content

Support `returning` for `BulkInsertSafe.bulk_insert!`

What does this MR do?

This extends the BulkInsertSafe.bulk_insert! method with the returns options. The allowed values are :ids to return an array of IDs or nil to omit the underlying RETURNING SQL clause entirely returning an empty array. In the future, we should support also records value to return an array of ActiveRecord instances.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related issues

Closes #212231 (closed)

Edited by Kamil Trzciński

Merge request reports