An immutable class that represents a query signature.
Inherits From: expected_type
google.appengine.datastore.datastore_query.Query(
app=None,
namespace=None,
kind=None,
ancestor=None,
filter_predicate=None,
group_by=None,
order=None,
read_time_us=None
)
A query signature consists of a source of entities (specified as app,
namespace and optionally kind and ancestor) as well as a FilterPredicate,
grouping and a desired ordering.
Args |
app
|
Optional app to query, derived from the environment if not specified.
|
namespace
|
Optional namespace to query, derived from the environment if
not specified.
|
kind
|
Optional kind to query.
|
ancestor
|
Optional ancestor to query, an entity_pb2.Reference.
|
filter_predicate
|
Optional FilterPredicate by which to restrict the query.
|
group_by
|
Optional list of properties to group the results by.
|
order
|
Optional Order in which to return results.
|
read_time_us
|
Optional timestamp to read the storage from. Internal use
only.
|
Raises |
datastore_errors.BadArgumentError if any argument is invalid.
|
Attributes |
ancestor
|
|
app
|
|
filter_predicate
|
|
group_by
|
|
kind
|
|
namespace
|
|
order
|
|
read_time_us
|
|
Methods
run
View source
run(
conn, query_options=None
)
Runs the query using provided datastore_rpc.Connection.
Args |
conn
|
The datastore_rpc.Connection to use
|
query_options
|
Optional query options to use
|
Returns |
A Batcher that implicitly fetches query results asynchronously.
|
Raises |
datastore_errors.BadArgumentError if any of the arguments are invalid.
|
run_async
View source
run_async(
conn, query_options=None
)
Runs the query using the provided datastore_rpc.Connection.
Args |
conn
|
the datastore_rpc.Connection on which to run the query.
|
query_options
|
Optional QueryOptions with which to run the query.
|
Returns |
An async object that can be used to grab the first Batch. Additional
batches can be retrieved by calling Batch.next_batch/next_batch_async.
|
Raises |
datastore_errors.BadArgumentError if any of the arguments are invalid.
|
__eq__
View source
__eq__(
other
)
Return self==value.
__ne__
View source
__ne__(
other
)
Return self!=value.