BaseDynamoQuery
Auto-generated documentation for dynamo_query.base_dynamo_query module.
Helper for building Boto3 DynamoDB queries.
- dynamo-query / Modules / Dynamo Query / BaseDynamoQuery
BaseDynamoQuery
class BaseDynamoQuery(LazyLogger):
def __init__(
query_type: QueryType,
expressions: ExpressionMap,
extra_params: Dict[(str, Any)],
limit: int = MAX_LIMIT,
exclusive_start_key: Optional[ExclusiveStartKey] = None,
logger: logging.Logger = None,
):
Base class for building Boto3 DynamoDB queries. Use
dynamo_query.DynamoQuery
instead.
query = BaseDynamoQuery(
query_type=QueryType.SCAN,
expressions={
BaseDynamoQuery.FILTER_EXPRESSION: ConditionExpression(
'first_name',
'last_name,
),
}
extra_params={}
limit=5,
)
Arguments
query_type
- QueryType item.expressions
- Expressions for query.extra_params
- Any exptra params to pass to boto3 method.limit
- Limit of results for scan/query requests.exclusive_start_key
- Start key for scan/query requests.logger
-logging.Logger
instance.
Attributes
MAX_PAGE_SIZE
- Max size of one scan/query request.:1000
MAX_BATCH_SIZE
- Max size of one batch_get/write/delete_item request.:25
MAX_LIMIT
- Max size of scan/query requests.:10000000000
See also
BaseDynamoQuery().client
@property
def client() -> DynamoDBClient:
See also
BaseDynamoQuery().has_more_results
def has_more_results() -> bool:
Whether scan
or query
request with limit
has more results to return.
Returns
True if query has more results than returned or was not yet executed.
BaseDynamoQuery().table_keys
@property
def table_keys() -> TableKeys:
See also
BaseDynamoQuery().table_resource
@property
def table_resource() -> Table:
See also
BaseDynamoQuery().was_executed
def was_executed() -> bool:
Whether query was excetuted at least once.
Returns
True if query was executed.
DynamoQueryError
class DynamoQueryError(Exception):
Main error for dynamo_query.dynamo_query.DynamoQuery
class.