File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -677,13 +677,13 @@ def execute_sql(self, returning_fields=None):
677
677
678
678
field_values [field .column ] = value
679
679
objs .append (field_values )
680
- return [ self .insert (objs , returning_fields = returning_fields )]
680
+ return self .insert (objs , returning_fields = returning_fields )
681
681
682
682
@wrap_database_errors
683
683
def insert (self , docs , returning_fields = None ):
684
684
"""Store a list of documents using field columns as element names."""
685
685
inserted_ids = self .collection .insert_many (docs ).inserted_ids
686
- return inserted_ids if returning_fields else []
686
+ return [( x ,) for x in inserted_ids ] if returning_fields else []
687
687
688
688
@cached_property
689
689
def collection_name (self ):
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
10
10
allows_multiple_constraints_on_same_fields = False
11
11
can_create_inline_fk = False
12
12
can_introspect_foreign_keys = False
13
+ can_return_rows_from_bulk_insert = True
13
14
greatest_least_ignores_nulls = True
14
15
has_json_object_function = False
15
16
has_native_json_field = True
You can’t perform that action at this time.
0 commit comments