@@ -171,6 +171,7 @@ def explain(
171
171
all_plans : bool = False ,
172
172
max_plans : Optional [int ] = None ,
173
173
opt_rules : Optional [Sequence [str ]] = None ,
174
+ bind_vars : Optional [MutableMapping [str , str ]] = None ,
174
175
) -> Result [Union [Json , Jsons ]]:
175
176
"""Inspect the query and return its metadata without executing it.
176
177
@@ -184,6 +185,8 @@ def explain(
184
185
:type max_plans: int
185
186
:param opt_rules: List of optimizer rules.
186
187
:type opt_rules: list
188
+ :param bind_vars: Bind variables for the query.
189
+ :type bind_vars: dict
187
190
:return: Execution plan, or plans if **all_plans** was set to True.
188
191
:rtype: dict | list
189
192
:raise arango.exceptions.AQLQueryExplainError: If explain fails.
@@ -194,10 +197,14 @@ def explain(
194
197
if opt_rules is not None :
195
198
options ["optimizer" ] = {"rules" : opt_rules }
196
199
200
+ data : Json = {"query" : query , "options" : options }
201
+ if bind_vars is not None :
202
+ data ["bindVars" ] = bind_vars
203
+
197
204
request = Request (
198
205
method = "post" ,
199
206
endpoint = "/_api/explain" ,
200
- data = { "query" : query , "options" : options } ,
207
+ data = data ,
201
208
)
202
209
203
210
def response_handler (resp : Response ) -> Union [Json , Jsons ]:
0 commit comments