MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / _set_named_args

Method _set_named_args

couchbase/logic/n1ql.py:354–368  ·  view source on GitHub ↗

Set a named parameter in the query. The named field must exist in the query itself. :param kv: Key-Value pairs representing values within the query. These values should be stripped of their leading `$` identifier.

(self, **kv)

Source from the content-addressed store, hash-verified

352 self._set_named_args(**kwargs)
353
354 def _set_named_args(self, **kv):
355 """
356 Set a named parameter in the query. The named field must
357 exist in the query itself.
358
359 :param kv: Key-Value pairs representing values within the
360 query. These values should be stripped of their leading
361 `$` identifier.
362
363 """
364 arg_dict = self._params.setdefault("named_parameters", {})
365 # C++ core wants all args JSONified bytes
366 named_params = {f'${k}': json.dumps(v).encode('utf-8') for k, v in kv.items()}
367 arg_dict.update(named_params)
368 return self
369
370 def _add_pos_args(self, *args):
371 """

Callers 1

__init__Method · 0.95

Calls 3

setdefaultMethod · 0.80
updateMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected