You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For parameterized query execution, `pool.execute_with_retries()` and `tx.execute()` behave similarly. To execute parameterized queries, you need to pass a dictionary with parameters to one of these functions, where each key is the parameter name, and the value can be one of the following:
287
305
288
-
1. A value of a basic Python type
289
-
2. A tuple containing the value and its type
290
-
3. A special type, `ydb.TypedValue(value=value, value_type=value_type)`
306
+
1. A value of a basic Python type
307
+
2. A tuple containing the value and its type
308
+
3. A special type, `ydb.TypedValue(value=value, value_type=value_type)`
291
309
292
310
If you specify a value without an explicit type, the conversion takes place according to the following rules:
293
311
@@ -303,7 +321,7 @@ If you specify a value without an explicit type, the conversion takes place acco
303
321
304
322
{% note warning %}
305
323
306
-
Automatic conversion of lists and dictionaries is possible only if the structures are homogeneous. The type of nested values will be determined recursively according to the rules explained above.
324
+
Automatic conversion of lists and dictionaries is possible only if the structures are homogeneous. The type of nested values will be determined recursively according to the rules explained above. In case of using heterogeneous structures, requests will raise `TypeError`.
307
325
308
326
{% endnote %}
309
327
@@ -394,7 +412,7 @@ Available transaction modes:
394
412
395
413
For more information about transaction modes, see [{#T}](../../../concepts/transactions.md#modes).
396
414
397
-
The result of executing `tx.execute()` is an iterator. This iterator allows you to read result rows without loading the entire result set into memory. However, the iterator must be read to the end after each request to correctly maintain the transaction state on the {{ ydb-short-name }} server side. For convenience, the result of the `tx.execute()` function can be used as a context manager that automatically iterates to the end upon exit.
415
+
The result of executing `tx.execute()` is an iterator. This iterator allows you to read result rows without loading the entire result set into memory. However, the iterator must be read to the end after each request to correctly maintain the transaction state on the {{ ydb-short-name }} server side. If this is not done, write queries could not be applied on the {{ ydb-short-name }} server side. For convenience, the result of the `tx.execute()` function can be used as a context manager that automatically iterates to the end upon exit.
398
416
399
417
{% list tabs %}
400
418
@@ -414,7 +432,7 @@ The result of executing `tx.execute()` is an iterator. This iterator allows you
414
432
415
433
{% endlist %}
416
434
417
-
The code snippet below demonstrates the explicit use of `transaction().begin()` and `tx.commit()` with the transaction mode set to `ydb.QuerySerializableReadWrite()`:
435
+
The code snippet below demonstrates the explicit use of `transaction().begin()` and `tx.commit()`:
418
436
419
437
{% list tabs %}
420
438
@@ -434,7 +452,7 @@ The code snippet below demonstrates the explicit use of `transaction().begin()`
0 commit comments