Skip to main content
Version: 0.6

query

superduper.base.query

Source code

bind​

bind(f)
ParameterDescription
fThe method to bind.

Bind a method to a query object.

parse_query​

parse_query(query: Union[str,
list],
documents: Sequence[Any] = (),
db: Optional[ForwardRef('Datalayer')] = None)
ParameterDescription
queryThe query to parse.
documentsThe documents to query.
dbThe datalayer to use to execute the query.

Parse a string query into a query object.

Query​

Query(self,
*,
parts: Sequence[Union[superduper.base.query.QueryPart,
str]] = <factory>,
table: str,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None) -> None
ParameterDescription
tableThe table to use.
partsThe parts of the query.
dbThe Datalayer instance to use.

A query object.

This base class is used to create a query object that can be executed in the datalayer.

Decomposition​

Decomposition(self,
table: str,
db: 'Datalayer',
col: str | None = None,
insert: superduper.base.query.QueryPart | None = None,
pre_like: superduper.base.query.QueryPart | None = None,
post_like: superduper.base.query.QueryPart | None = None,
filter: superduper.base.query.QueryPart | None = None,
select: superduper.base.query.QueryPart | None = None,
get: superduper.base.query.QueryPart | None = None,
limit: superduper.base.query.QueryPart | None = None,
outputs: superduper.base.query.QueryPart | None = None,
op: superduper.base.query.Op | None = None) -> None
ParameterDescription
tableThe table to use.
dbThe datalayer to use.
colThe column to use.
insertThe insert part of the query.
pre_likeThe pre-like part of the query.
post_likeThe post-like part of the query.
filterThe filter part of the query.
selectThe select part of the query.
getThe get part of the query.
limitThe limit part of the query.
outputsThe outputs part of the query.
opThe operation part of the query.

Decompose a query into its parts.

Op​

Op(self,
name: str,
args: Sequence,
kwargs: Dict,
symbol: str) -> None
ParameterDescription
nameThe name of the method.
argsThe arguments of the method.
kwargsThe keyword arguments of the method.
symbolThe symbol of the operation.

An operation part of a query.

QueryPart​

QueryPart(self,
name: str,
args: Sequence,
kwargs: Dict) -> None
ParameterDescription
nameThe name of the method.
argsThe arguments of the method.
kwargsThe keyword arguments of the method.

A method part of a query.