@@ -36,9 +36,31 @@ class Query:
36
36
37
37
:param text: The query text.
38
38
:type text: typing.LiteralString
39
- :param metadata: metadata attached to the query.
39
+ :param metadata:
40
+ a dictionary with metadata.
41
+ Specified metadata will be attached to the executing transaction
42
+ and visible in the output of ``SHOW TRANSACTIONS YIELD *``
43
+ It will also get logged to the ``query.log``.
44
+ This functionality makes it easier to tag transactions and is
45
+ equivalent to the ``dbms.setTXMetaData`` procedure, see
46
+ https://neo4j.com/docs/cypher-manual/current/clauses/transaction-clauses/#query-listing-transactions
47
+ and https://neo4j.com/docs/operations-manual/current/reference/procedures/
48
+ for reference.
40
49
:type metadata: typing.Dict[str, typing.Any] | None
41
- :param timeout: seconds.
50
+ :param timeout:
51
+ the transaction timeout in seconds.
52
+ Transactions that execute longer than the configured timeout will
53
+ be terminated by the database.
54
+ This functionality allows to limit query/transaction execution
55
+ time.
56
+ The Specified timeout overrides the default timeout configured in
57
+ the database using the ``db.transaction.timeout`` setting
58
+ (``dbms.transaction.timeout`` before Neo4j 5.0).
59
+ Values higher than ``db.transaction.timeout`` will be ignored and
60
+ will fall back to the default for server versions 4.2 to including
61
+ 5.2. The value should not represent a negative duration.
62
+ A ``0`` duration will make the transaction execute indefinitely.
63
+ :data:`None` will use the default timeout configured on the server.
42
64
:type timeout: float | None
43
65
"""
44
66
def __init__ (
@@ -90,16 +112,18 @@ def count_people_tx(tx):
90
112
91
113
:param timeout:
92
114
the transaction timeout in seconds.
93
- Transactions that execute longer than the configured timeout will be
94
- terminated by the database.
95
- This functionality allows to limit query/transaction execution time.
96
- Specified timeout overrides the default timeout configured in the
97
- database using ``dbms.transaction.timeout`` setting.
98
- Values higher than ``dbms.transaction.timeout`` will be ignored and
99
- will fall back to default (unless using Neo4j < 4.2).
100
- Value should not represent a negative duration.
101
- A zero duration will make the transaction execute indefinitely.
102
- None will use the default timeout configured in the database.
115
+ Transactions that execute longer than the configured timeout will
116
+ be terminated by the database.
117
+ This functionality allows to limit query/transaction execution
118
+ time.
119
+ The Specified timeout overrides the default timeout configured in
120
+ the database using the ``db.transaction.timeout`` setting
121
+ (``dbms.transaction.timeout`` before Neo4j 5.0).
122
+ Values higher than ``db.transaction.timeout`` will be ignored and
123
+ will fall back to the default for server versions 4.2 to including
124
+ 5.2. The value should not represent a negative duration.
125
+ A ``0`` duration will make the transaction execute indefinitely.
126
+ :data:`None` will use the default timeout configured on the server.
103
127
:type timeout: float | None
104
128
105
129
:rtype: typing.Callable[[T], T]
0 commit comments