MCPcopy
hub / github.com/psycopg/psycopg / args_row

Function args_row

psycopg/psycopg/rows.py:172–185  ·  view source on GitHub ↗

Generate a row factory calling `!func` with positional parameters for every row. :param func: The function to call for each row. It must support the fields returned by the query as positional arguments.

(func: Callable[..., T])

Source from the content-addressed store, hash-verified

170
171
172def args_row(func: Callable[..., T]) -> BaseRowFactory[T]:
173 """Generate a row factory calling `!func` with positional parameters for every row.
174
175 :param func: The function to call for each row. It must support the fields
176 returned by the query as positional arguments.
177 """
178
179 def args_row_(cur: BaseCursor[Any, T]) -> RowMaker[T]:
180 def args_row__(values: Sequence[Any]) -> T:
181 return func(*values)
182
183 return args_row__
184
185 return args_row_
186
187
188def kwargs_row(func: Callable[..., T]) -> BaseRowFactory[T]:

Callers 2

tpc_recoverMethod · 0.85
tpc_recoverMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected