class documentation
Metadata defining a certain function on a protocol as a query method.
| Class Method | decorate |
Attach a QueryMetadata to the given protocol method definition, checking its arguments and computing proxyMethod in the process, raising ParamMismatch if the expected parameters do not match. |
| Class Method | filter |
Filter the namespace of a given typing.Protocol object to find all the methods decorated with query or statement, and return the QueryMetadata objects corresponding to those decorations, paired with their names. |
| Class Method | load |
Load the query metadata for f if it has any. |
| Method | compute |
Undocumented |
| Method | implement |
Construct an implementation of the method at runtime. |
| Class Variable | compilation |
Undocumented |
| Class Variable | load |
Undocumented |
| Class Variable | name |
Undocumented |
| Class Variable | signature |
Undocumented |
| Class Variable | sql |
Undocumented |
def decorateMethod(cls, protocolMethod:
Any, sql: str | ReturnsRows, load: Callable[ [ AccessProxy, AsyncCursor], A]):
(source)
¶
Attach a QueryMetadata to the given protocol method definition, checking its arguments and computing proxyMethod in the process, raising ParamMismatch if the expected parameters do not match.
def filterProtocolNamespace(cls, protocolNamespace:
Iterable[ tuple[ str, object]]) -> Iterable[ tuple[ str, QueryMetadata]]:
(source)
¶
Filter the namespace of a given typing.Protocol object to find all the methods decorated with query or statement, and return the QueryMetadata objects corresponding to those decorations, paired with their names.
| Returns | |
Iterable[ | an iterable of 2-tuples of (name of method decorated with query, QueryMetadata object describing that query). |