Do nothing if em.insertMany()
is passed an empty array
#4640
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
When calling
em.insertMany()
with an empty array instead of doing nothing it tries to insert anyway and generates an invalid query, resulting in:Describe the solution you'd like
I want it to ignore an empty array of entities. I know it's supposed to be a native insert query that provides direct access to the db, but I think this simple convenience like this is not too much to ask.
Describe alternatives you've considered
I can always wrap my call in a check. For example:
but it's wordy
Additional context
The invalid SQL query mentioned earlier is encountered in miko-orm 5.6.7.
Meanwhile in 6.0.0-dev.87 I seem to get a TypeError instead:
The text was updated successfully, but these errors were encountered: