File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,20 @@ for every tuple. This dictionary always has a ``rowcount`` key, indicating
76
76
how many rows were inserted. If an error occurs, the ``rowcount `` value is
77
77
``-2 ``, and the dictionary may additionally have an ``error_message `` key.
78
78
79
+ The package includes a helper utility ``BulkResponse `` that supports parsing
80
+ such responses to bulk operation requests. It works like this::
81
+
82
+ from crate.client.result import BulkResponse
83
+
84
+ result = cursor.executemany(statement, records)
85
+ bulk_response = BulkResponse(records, result)
86
+
87
+ It provides properties ``failed_records ``, ``record_count ``, ``success_count ``,
88
+ and ``failed_count ``. ``failed_records `` will provide information which records
89
+ of the bulk operation failed to succeed, by evaluating ``{'rowcount': -2} ``
90
+ items, and matching them against submitted records.
91
+
92
+
79
93
.. _selects :
80
94
81
95
Selecting data
You can’t perform that action at this time.
0 commit comments