Struct aws_sdk_dynamodb::operation::query::builders::QueryFluentBuilder
source · pub struct QueryFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to Query
.
You must provide the name of the partition key attribute and a single value for that attribute. Query
returns all items with that partition key value. Optionally, you can provide a sort key attribute and use a comparison operator to refine the search results.
Use the KeyConditionExpression
parameter to provide a specific value for the partition key. The Query
operation will return all of the items from the table or index with that partition key value. You can optionally narrow the scope of the Query
operation by specifying a sort key value and a comparison operator in KeyConditionExpression
. To further refine the Query
results, you can optionally provide a FilterExpression
. A FilterExpression
determines which items within the results should be returned to you. All of the other results are discarded.
A Query
operation always returns a result set. If no matching items are found, the result set will be empty. Queries that do not return results consume the minimum number of read capacity units for that type of read operation.
DynamoDB calculates the number of read capacity units consumed based on item size, not on the amount of data that is returned to an application. The number of capacity units consumed will be the same whether you request all of the attributes (the default behavior) or just some of them (using a projection expression). The number will also be the same whether or not you use a FilterExpression
.
Query
results are always sorted by the sort key value. If the data type of the sort key is Number, the results are returned in numeric order; otherwise, the results are returned in order of UTF-8 bytes. By default, the sort order is ascending. To reverse the order, set the ScanIndexForward
parameter to false.
A single Query
operation will read up to the maximum number of items set (if using the Limit
parameter) or a maximum of 1 MB of data and then apply any filtering to the results using FilterExpression
. If LastEvaluatedKey
is present in the response, you will need to paginate the result set. For more information, see Paginating the Results in the Amazon DynamoDB Developer Guide.
FilterExpression
is applied after a Query
finishes, but before the results are returned. A FilterExpression
cannot contain partition key or sort key attributes. You need to specify those attributes in the KeyConditionExpression
.
A Query
operation can return an empty result set and a LastEvaluatedKey
if all the items read for the page of results are filtered out.
You can query a table, a local secondary index, or a global secondary index. For a query on a table or on a local secondary index, you can set the ConsistentRead
parameter to true
and obtain a strongly consistent result. Global secondary indexes support eventually consistent reads only, so do not specify ConsistentRead
when querying a global secondary index.
Implementations§
source§impl QueryFluentBuilder
impl QueryFluentBuilder
sourcepub fn as_input(&self) -> &QueryInputBuilder
pub fn as_input(&self) -> &QueryInputBuilder
Access the Query as a reference.
sourcepub async fn send(
self,
) -> Result<QueryOutput, SdkError<QueryError, HttpResponse>>
pub async fn send( self, ) -> Result<QueryOutput, SdkError<QueryError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(self) -> CustomizableOperation<QueryOutput, QueryError, Self>
pub fn customize(self) -> CustomizableOperation<QueryOutput, QueryError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn into_paginator(self) -> QueryPaginator
pub fn into_paginator(self) -> QueryPaginator
Create a paginator for this request
Paginators are used by calling send().await
which returns a PaginationStream
.
sourcepub fn table_name(self, input: impl Into<String>) -> Self
pub fn table_name(self, input: impl Into<String>) -> Self
The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
sourcepub fn set_table_name(self, input: Option<String>) -> Self
pub fn set_table_name(self, input: Option<String>) -> Self
The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
sourcepub fn get_table_name(&self) -> &Option<String>
pub fn get_table_name(&self) -> &Option<String>
The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
sourcepub fn index_name(self, input: impl Into<String>) -> Self
pub fn index_name(self, input: impl Into<String>) -> Self
The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the IndexName
parameter, you must also provide TableName.
sourcepub fn set_index_name(self, input: Option<String>) -> Self
pub fn set_index_name(self, input: Option<String>) -> Self
The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the IndexName
parameter, you must also provide TableName.
sourcepub fn get_index_name(&self) -> &Option<String>
pub fn get_index_name(&self) -> &Option<String>
The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the IndexName
parameter, you must also provide TableName.
sourcepub fn select(self, input: Select) -> Self
pub fn select(self, input: Select) -> Self
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
-
ALL_ATTRIBUTES
- Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. -
ALL_PROJECTED_ATTRIBUTES
- Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifyingALL_ATTRIBUTES
. -
COUNT
- Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations. -
SPECIFIC_ATTRIBUTES
- Returns only the attributes listed inProjectionExpression
. This return value is equivalent to specifyingProjectionExpression
without specifying any value forSelect
.If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither Select
nor ProjectionExpression
are specified, DynamoDB defaults to ALL_ATTRIBUTES
when accessing a table, and ALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use both Select
and ProjectionExpression
together in a single request, unless the value for Select
is SPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifying ProjectionExpression
without any value for Select
.)
If you use the ProjectionExpression
parameter, then the value for Select
can only be SPECIFIC_ATTRIBUTES
. Any other value for Select
will return an error.
sourcepub fn set_select(self, input: Option<Select>) -> Self
pub fn set_select(self, input: Option<Select>) -> Self
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
-
ALL_ATTRIBUTES
- Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. -
ALL_PROJECTED_ATTRIBUTES
- Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifyingALL_ATTRIBUTES
. -
COUNT
- Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations. -
SPECIFIC_ATTRIBUTES
- Returns only the attributes listed inProjectionExpression
. This return value is equivalent to specifyingProjectionExpression
without specifying any value forSelect
.If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither Select
nor ProjectionExpression
are specified, DynamoDB defaults to ALL_ATTRIBUTES
when accessing a table, and ALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use both Select
and ProjectionExpression
together in a single request, unless the value for Select
is SPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifying ProjectionExpression
without any value for Select
.)
If you use the ProjectionExpression
parameter, then the value for Select
can only be SPECIFIC_ATTRIBUTES
. Any other value for Select
will return an error.
sourcepub fn get_select(&self) -> &Option<Select>
pub fn get_select(&self) -> &Option<Select>
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
-
ALL_ATTRIBUTES
- Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. -
ALL_PROJECTED_ATTRIBUTES
- Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifyingALL_ATTRIBUTES
. -
COUNT
- Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations. -
SPECIFIC_ATTRIBUTES
- Returns only the attributes listed inProjectionExpression
. This return value is equivalent to specifyingProjectionExpression
without specifying any value forSelect
.If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither Select
nor ProjectionExpression
are specified, DynamoDB defaults to ALL_ATTRIBUTES
when accessing a table, and ALL_PROJECTED_ATTRIBUTES
when accessing an index. You cannot use both Select
and ProjectionExpression
together in a single request, unless the value for Select
is SPECIFIC_ATTRIBUTES
. (This usage is equivalent to specifying ProjectionExpression
without any value for Select
.)
If you use the ProjectionExpression
parameter, then the value for Select
can only be SPECIFIC_ATTRIBUTES
. Any other value for Select
will return an error.
sourcepub fn attributes_to_get(self, input: impl Into<String>) -> Self
pub fn attributes_to_get(self, input: impl Into<String>) -> Self
Appends an item to AttributesToGet
.
To override the contents of this collection use set_attributes_to_get
.
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
sourcepub fn set_attributes_to_get(self, input: Option<Vec<String>>) -> Self
pub fn set_attributes_to_get(self, input: Option<Vec<String>>) -> Self
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
sourcepub fn get_attributes_to_get(&self) -> &Option<Vec<String>>
pub fn get_attributes_to_get(&self) -> &Option<Vec<String>>
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
sourcepub fn limit(self, input: i32) -> Self
pub fn limit(self, input: i32) -> Self
The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey
to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey
to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.
sourcepub fn set_limit(self, input: Option<i32>) -> Self
pub fn set_limit(self, input: Option<i32>) -> Self
The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey
to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey
to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.
sourcepub fn get_limit(&self) -> &Option<i32>
pub fn get_limit(&self) -> &Option<i32>
The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey
to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey
to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.
sourcepub fn consistent_read(self, input: bool) -> Self
pub fn consistent_read(self, input: bool) -> Self
Determines the read consistency model: If set to true
, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.
Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead
set to true
, you will receive a ValidationException
.
sourcepub fn set_consistent_read(self, input: Option<bool>) -> Self
pub fn set_consistent_read(self, input: Option<bool>) -> Self
Determines the read consistency model: If set to true
, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.
Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead
set to true
, you will receive a ValidationException
.
sourcepub fn get_consistent_read(&self) -> &Option<bool>
pub fn get_consistent_read(&self) -> &Option<bool>
Determines the read consistency model: If set to true
, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.
Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead
set to true
, you will receive a ValidationException
.
sourcepub fn key_conditions(self, k: impl Into<String>, v: Condition) -> Self
pub fn key_conditions(self, k: impl Into<String>, v: Condition) -> Self
Adds a key-value pair to KeyConditions
.
To override the contents of this collection use set_key_conditions
.
This is a legacy parameter. Use KeyConditionExpression
instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide.
sourcepub fn set_key_conditions(
self,
input: Option<HashMap<String, Condition>>,
) -> Self
pub fn set_key_conditions( self, input: Option<HashMap<String, Condition>>, ) -> Self
This is a legacy parameter. Use KeyConditionExpression
instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide.
sourcepub fn get_key_conditions(&self) -> &Option<HashMap<String, Condition>>
pub fn get_key_conditions(&self) -> &Option<HashMap<String, Condition>>
This is a legacy parameter. Use KeyConditionExpression
instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide.
sourcepub fn query_filter(self, k: impl Into<String>, v: Condition) -> Self
pub fn query_filter(self, k: impl Into<String>, v: Condition) -> Self
Adds a key-value pair to QueryFilter
.
To override the contents of this collection use set_query_filter
.
This is a legacy parameter. Use FilterExpression
instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide.
sourcepub fn set_query_filter(self, input: Option<HashMap<String, Condition>>) -> Self
pub fn set_query_filter(self, input: Option<HashMap<String, Condition>>) -> Self
This is a legacy parameter. Use FilterExpression
instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide.
sourcepub fn get_query_filter(&self) -> &Option<HashMap<String, Condition>>
pub fn get_query_filter(&self) -> &Option<HashMap<String, Condition>>
This is a legacy parameter. Use FilterExpression
instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide.
sourcepub fn conditional_operator(self, input: ConditionalOperator) -> Self
pub fn conditional_operator(self, input: ConditionalOperator) -> Self
This is a legacy parameter. Use FilterExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.
sourcepub fn set_conditional_operator(
self,
input: Option<ConditionalOperator>,
) -> Self
pub fn set_conditional_operator( self, input: Option<ConditionalOperator>, ) -> Self
This is a legacy parameter. Use FilterExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.
sourcepub fn get_conditional_operator(&self) -> &Option<ConditionalOperator>
pub fn get_conditional_operator(&self) -> &Option<ConditionalOperator>
This is a legacy parameter. Use FilterExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.
sourcepub fn scan_index_forward(self, input: bool) -> Self
pub fn scan_index_forward(self, input: bool) -> Self
Specifies the order for index traversal: If true
(default), the traversal is performed in ascending order; if false
, the traversal is performed in descending order.
Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.
If ScanIndexForward
is true
, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward
is false
, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.
sourcepub fn set_scan_index_forward(self, input: Option<bool>) -> Self
pub fn set_scan_index_forward(self, input: Option<bool>) -> Self
Specifies the order for index traversal: If true
(default), the traversal is performed in ascending order; if false
, the traversal is performed in descending order.
Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.
If ScanIndexForward
is true
, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward
is false
, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.
sourcepub fn get_scan_index_forward(&self) -> &Option<bool>
pub fn get_scan_index_forward(&self) -> &Option<bool>
Specifies the order for index traversal: If true
(default), the traversal is performed in ascending order; if false
, the traversal is performed in descending order.
Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.
If ScanIndexForward
is true
, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward
is false
, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.
sourcepub fn exclusive_start_key(
self,
k: impl Into<String>,
v: AttributeValue,
) -> Self
pub fn exclusive_start_key( self, k: impl Into<String>, v: AttributeValue, ) -> Self
Adds a key-value pair to ExclusiveStartKey
.
To override the contents of this collection use set_exclusive_start_key
.
The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey
in the previous operation.
The data type for ExclusiveStartKey
must be String, Number, or Binary. No set data types are allowed.
sourcepub fn set_exclusive_start_key(
self,
input: Option<HashMap<String, AttributeValue>>,
) -> Self
pub fn set_exclusive_start_key( self, input: Option<HashMap<String, AttributeValue>>, ) -> Self
The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey
in the previous operation.
The data type for ExclusiveStartKey
must be String, Number, or Binary. No set data types are allowed.
sourcepub fn get_exclusive_start_key(
&self,
) -> &Option<HashMap<String, AttributeValue>>
pub fn get_exclusive_start_key( &self, ) -> &Option<HashMap<String, AttributeValue>>
The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey
in the previous operation.
The data type for ExclusiveStartKey
must be String, Number, or Binary. No set data types are allowed.
sourcepub fn return_consumed_capacity(self, input: ReturnConsumedCapacity) -> Self
pub fn return_consumed_capacity(self, input: ReturnConsumedCapacity) -> Self
Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
sourcepub fn set_return_consumed_capacity(
self,
input: Option<ReturnConsumedCapacity>,
) -> Self
pub fn set_return_consumed_capacity( self, input: Option<ReturnConsumedCapacity>, ) -> Self
Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
sourcepub fn get_return_consumed_capacity(&self) -> &Option<ReturnConsumedCapacity>
pub fn get_return_consumed_capacity(&self) -> &Option<ReturnConsumedCapacity>
Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:
-
INDEXES
- The response includes the aggregateConsumedCapacity
for the operation, together withConsumedCapacity
for each table and secondary index that was accessed.Note that some operations, such as
GetItem
andBatchGetItem
, do not access any indexes at all. In these cases, specifyingINDEXES
will only returnConsumedCapacity
information for table(s). -
TOTAL
- The response includes only the aggregateConsumedCapacity
for the operation. -
NONE
- NoConsumedCapacity
details are included in the response.
sourcepub fn projection_expression(self, input: impl Into<String>) -> Self
pub fn projection_expression(self, input: impl Into<String>) -> Self
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn set_projection_expression(self, input: Option<String>) -> Self
pub fn set_projection_expression(self, input: Option<String>) -> Self
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn get_projection_expression(&self) -> &Option<String>
pub fn get_projection_expression(&self) -> &Option<String>
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn filter_expression(self, input: impl Into<String>) -> Self
pub fn filter_expression(self, input: impl Into<String>) -> Self
A string that contains conditions that DynamoDB applies after the Query
operation, but before the data is returned to you. Items that do not satisfy the FilterExpression
criteria are not returned.
A FilterExpression
does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.
A FilterExpression
is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.
For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.
sourcepub fn set_filter_expression(self, input: Option<String>) -> Self
pub fn set_filter_expression(self, input: Option<String>) -> Self
A string that contains conditions that DynamoDB applies after the Query
operation, but before the data is returned to you. Items that do not satisfy the FilterExpression
criteria are not returned.
A FilterExpression
does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.
A FilterExpression
is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.
For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.
sourcepub fn get_filter_expression(&self) -> &Option<String>
pub fn get_filter_expression(&self) -> &Option<String>
A string that contains conditions that DynamoDB applies after the Query
operation, but before the data is returned to you. Items that do not satisfy the FilterExpression
criteria are not returned.
A FilterExpression
does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.
A FilterExpression
is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.
For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.
sourcepub fn key_condition_expression(self, input: impl Into<String>) -> Self
pub fn key_condition_expression(self, input: impl Into<String>) -> Self
The condition that specifies the key values for items to be retrieved by the Query
action.
The condition must perform an equality test on a single partition key value.
The condition can optionally perform one of several comparison tests on a single sort key value. This allows Query
to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.
The partition key equality test is required, and must be specified in the following format:
partitionKeyName
= :partitionkeyval
If you also want to provide a condition for the sort key, it must be combined using AND
with the condition for the sort key. Following is an example, using the = comparison operator for the sort key:
partitionKeyName
=
:partitionkeyval
AND
sortKeyName
=
:sortkeyval
Valid comparisons for the sort key condition are as follows:
-
sortKeyName
=
:sortkeyval
- true if the sort key value is equal to:sortkeyval
. -
sortKeyName
<
:sortkeyval
- true if the sort key value is less than:sortkeyval
. -
sortKeyName
<=
:sortkeyval
- true if the sort key value is less than or equal to:sortkeyval
. -
sortKeyName
>
:sortkeyval
- true if the sort key value is greater than:sortkeyval
. -
sortKeyName
>=
:sortkeyval
- true if the sort key value is greater than or equal to:sortkeyval
. -
sortKeyName
BETWEEN
:sortkeyval1
AND
:sortkeyval2
- true if the sort key value is greater than or equal to:sortkeyval1
, and less than or equal to:sortkeyval2
. -
begins_with (
sortKeyName
,:sortkeyval
)
- true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function namebegins_with
is case-sensitive.
Use the ExpressionAttributeValues
parameter to replace tokens such as :partitionval
and :sortval
with actual values at runtime.
You can optionally use the ExpressionAttributeNames
parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression
parameter causes an error because Size is a reserved word:
-
Size = :myval
To work around this, define a placeholder (such a #S
) to represent the attribute name Size. KeyConditionExpression
then is as follows:
-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames
and ExpressionAttributeValues
, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
sourcepub fn set_key_condition_expression(self, input: Option<String>) -> Self
pub fn set_key_condition_expression(self, input: Option<String>) -> Self
The condition that specifies the key values for items to be retrieved by the Query
action.
The condition must perform an equality test on a single partition key value.
The condition can optionally perform one of several comparison tests on a single sort key value. This allows Query
to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.
The partition key equality test is required, and must be specified in the following format:
partitionKeyName
= :partitionkeyval
If you also want to provide a condition for the sort key, it must be combined using AND
with the condition for the sort key. Following is an example, using the = comparison operator for the sort key:
partitionKeyName
=
:partitionkeyval
AND
sortKeyName
=
:sortkeyval
Valid comparisons for the sort key condition are as follows:
-
sortKeyName
=
:sortkeyval
- true if the sort key value is equal to:sortkeyval
. -
sortKeyName
<
:sortkeyval
- true if the sort key value is less than:sortkeyval
. -
sortKeyName
<=
:sortkeyval
- true if the sort key value is less than or equal to:sortkeyval
. -
sortKeyName
>
:sortkeyval
- true if the sort key value is greater than:sortkeyval
. -
sortKeyName
>=
:sortkeyval
- true if the sort key value is greater than or equal to:sortkeyval
. -
sortKeyName
BETWEEN
:sortkeyval1
AND
:sortkeyval2
- true if the sort key value is greater than or equal to:sortkeyval1
, and less than or equal to:sortkeyval2
. -
begins_with (
sortKeyName
,:sortkeyval
)
- true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function namebegins_with
is case-sensitive.
Use the ExpressionAttributeValues
parameter to replace tokens such as :partitionval
and :sortval
with actual values at runtime.
You can optionally use the ExpressionAttributeNames
parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression
parameter causes an error because Size is a reserved word:
-
Size = :myval
To work around this, define a placeholder (such a #S
) to represent the attribute name Size. KeyConditionExpression
then is as follows:
-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames
and ExpressionAttributeValues
, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
sourcepub fn get_key_condition_expression(&self) -> &Option<String>
pub fn get_key_condition_expression(&self) -> &Option<String>
The condition that specifies the key values for items to be retrieved by the Query
action.
The condition must perform an equality test on a single partition key value.
The condition can optionally perform one of several comparison tests on a single sort key value. This allows Query
to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.
The partition key equality test is required, and must be specified in the following format:
partitionKeyName
= :partitionkeyval
If you also want to provide a condition for the sort key, it must be combined using AND
with the condition for the sort key. Following is an example, using the = comparison operator for the sort key:
partitionKeyName
=
:partitionkeyval
AND
sortKeyName
=
:sortkeyval
Valid comparisons for the sort key condition are as follows:
-
sortKeyName
=
:sortkeyval
- true if the sort key value is equal to:sortkeyval
. -
sortKeyName
<
:sortkeyval
- true if the sort key value is less than:sortkeyval
. -
sortKeyName
<=
:sortkeyval
- true if the sort key value is less than or equal to:sortkeyval
. -
sortKeyName
>
:sortkeyval
- true if the sort key value is greater than:sortkeyval
. -
sortKeyName
>=
:sortkeyval
- true if the sort key value is greater than or equal to:sortkeyval
. -
sortKeyName
BETWEEN
:sortkeyval1
AND
:sortkeyval2
- true if the sort key value is greater than or equal to:sortkeyval1
, and less than or equal to:sortkeyval2
. -
begins_with (
sortKeyName
,:sortkeyval
)
- true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function namebegins_with
is case-sensitive.
Use the ExpressionAttributeValues
parameter to replace tokens such as :partitionval
and :sortval
with actual values at runtime.
You can optionally use the ExpressionAttributeNames
parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression
parameter causes an error because Size is a reserved word:
-
Size = :myval
To work around this, define a placeholder (such a #S
) to represent the attribute name Size. KeyConditionExpression
then is as follows:
-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames
and ExpressionAttributeValues
, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
sourcepub fn expression_attribute_names(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn expression_attribute_names( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to ExpressionAttributeNames
.
To override the contents of this collection use set_expression_attribute_names
.
One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames
:
-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames
:
-
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn set_expression_attribute_names(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_expression_attribute_names( self, input: Option<HashMap<String, String>>, ) -> Self
One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames
:
-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames
:
-
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn get_expression_attribute_names(&self) -> &Option<HashMap<String, String>>
pub fn get_expression_attribute_names(&self) -> &Option<HashMap<String, String>>
One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames
:
-
To access an attribute whose name conflicts with a DynamoDB reserved word.
-
To create a placeholder for repeating occurrences of an attribute name in an expression.
-
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
-
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames
:
-
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
-
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
sourcepub fn expression_attribute_values(
self,
k: impl Into<String>,
v: AttributeValue,
) -> Self
pub fn expression_attribute_values( self, k: impl Into<String>, v: AttributeValue, ) -> Self
Adds a key-value pair to ExpressionAttributeValues
.
To override the contents of this collection use set_expression_attribute_values
.
One or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify ExpressionAttributeValues
as follows:
{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.
sourcepub fn set_expression_attribute_values(
self,
input: Option<HashMap<String, AttributeValue>>,
) -> Self
pub fn set_expression_attribute_values( self, input: Option<HashMap<String, AttributeValue>>, ) -> Self
One or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify ExpressionAttributeValues
as follows:
{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.
sourcepub fn get_expression_attribute_values(
&self,
) -> &Option<HashMap<String, AttributeValue>>
pub fn get_expression_attribute_values( &self, ) -> &Option<HashMap<String, AttributeValue>>
One or more values that can be substituted in an expression.
Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:
Available | Backordered | Discontinued
You would first need to specify ExpressionAttributeValues
as follows:
{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
You could then use these values in an expression, such as this:
ProductStatus IN (:avail, :back, :disc)
For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.
Trait Implementations§
source§impl Clone for QueryFluentBuilder
impl Clone for QueryFluentBuilder
source§fn clone(&self) -> QueryFluentBuilder
fn clone(&self) -> QueryFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for QueryFluentBuilder
impl !RefUnwindSafe for QueryFluentBuilder
impl Send for QueryFluentBuilder
impl Sync for QueryFluentBuilder
impl Unpin for QueryFluentBuilder
impl !UnwindSafe for QueryFluentBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);