Query and Scan builders
Bases: object
An object used to query dynamo tables
See the Engine for query examples
Parameters: | engine : Engine model : class
|
---|
Return the query results as a list
Parameters: | desc : bool, optional
consistent : bool, optional
attributes : list, optional
|
---|
Add a Condition to constrain the query
Notes
The conditions may be passed in as positional arguments:
engine.query(User).filter(User.id == 12345)
Or they may be passed in as keyword arguments:
engine.query(User).filter(firstname='Monty', lastname='Python')
The limitations of the keyword method is that you may only create equality conditions. You may use both types in a single filter:
engine.query(User).filter(User.num_friends > 10, name='Monty')
Return the first result of the query, or None if no results
Parameters: | desc : bool, optional
consistent : bool, optional
attributes : list, optional
|
---|
Return the query results as a generator
Parameters: | desc : bool, optional
consistent : bool, optional
attributes : list, optional
|
---|
Return the result of the query. If there is not exactly one result, raise a ValueError
Parameters: | consistent : bool, optional
attributes : list, optional
|
---|---|
Raises: | exc : ValueError
|
Bases: flywheel.query.Query
An object used to scan dynamo tables
scans are like Queries except they don’t use indexes. This means they iterate over all data in the table and are SLOW
Parameters: | engine : Engine model : class
|
---|