class documentation

class QueryMetadata(Generic[A]): (source)

View In Hierarchy

Metadata defining a certain function on a protocol as a query method.

Class Method decorateMethod 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 filterProtocolNamespace 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 loadFrom Load the query metadata for f if it has any.
Method computeSQLFor Undocumented
Method implement Construct an implementation of the method at runtime.
Class Variable compilationCache 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[tuple[str, QueryMetadata]]an iterable of 2-tuples of (name of method decorated with query, QueryMetadata object describing that query).
def loadFrom(cls, f: object) -> QueryMetadata | None: (source)

Load the query metadata for f if it has any.

def computeSQLFor(self, style: ParamStyle | Dialect) -> tuple[str, BinderMap]: (source)

Undocumented

def implement(self) -> Callable[..., Any]: (source)

Construct an implementation of the method at runtime.

compilationCache: dict[ParamStyle | Dialect, tuple[str, BinderMap]] = (source)

Undocumented

Undocumented

Undocumented

Undocumented