You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The sort key condition can restrict the query to a subset of the partition rows. A nil condition will return all rows in the partition.
188
+
2. The `query` operation will fail if any of the rows being returned are not of type `TestTypeA`.
189
+
3. The optional String returned by the `query` operation can be used as the `exclusiveStartKey` in another request to retrieve the next "page" of results from DynamoDB.
190
+
4. There is an overload of the `query` operation that doesn't accept a `limit` or `exclusiveStartKey`. This overload will internally handle the API pagination, making multiple calls to DynamoDB if necessary.
191
+
192
+
There is also an equivalent `getItems` call that uses DynamoDB's BatchGetItem API-
193
+
194
+
```swift
195
+
let batch: [StandardCompositePrimaryKey: StandardTypedDatabaseItem<TestTypeA>]
1. The sort key condition can restrict the query to a subset of the partition rows. A nil condition will return all rows in the partition.
204
-
2. The `query` operation will fail if the partition contains rows that are not specified in the output `PolymorphicOperationReturnType` type.
205
-
3. The optional String returned by the `query` operation can be used as the `exclusiveStartKey` in another request to retrieve the next "page" of results from DynamoDB.
206
-
4. There is an overload of the `query` operation that doesn't accept a `limit` or `exclusiveStartKey`. This overload will internally handle the API pagination, making multiple calls to DynamoDB if necessary.
239
+
1. The `polymorphicQuery` operation will fail if any of the rows being returned are not specified in the output `PolymorphicOperationReturnType` type.
207
240
208
241
A similar operation utilises DynamoDB's BatchGetItem API, returning items in a dictionary keyed by the provided `CompositePrimaryKey` instance-
209
242
210
243
```swift
211
-
let batch: [StandardCompositePrimaryKey: TestPolymorphicOperationReturnType] =tryawait table.getItems(forKeys: [key1, key2])
244
+
let batch: [StandardCompositePrimaryKey: TestPolymorphicOperationReturnType] =tryawait table.polymorphicGetItems(forKeys: [key1, key2])
This operation will automatically handle retrying unprocessed items (with exponential backoff) if the table doesn't have the capacity during the initial request.
223
256
224
-
## Monomorphic Queries
225
-
226
-
In addition to the `query` operation, there is a seperate set of operations that provide a simpler API when a query will only retrieve rows of the same type.
227
-
228
-
```swift
229
-
let (queryItems, nextPageToken): ([StandardTypedDatabaseItem<TestTypeA>], String?) =
To simply query a partition on an index that has no projected attributes, you can use the `DynamoDBCompositePrimaryKeysProjection` protocol and conforming types like ` AWSDynamoDBCompositePrimaryKeysProjection`. This type is created using a generator class in the same way as the primary table type-
@@ -347,6 +349,19 @@ You can write multiple database rows using either a bulk or [transaction](https:
0 commit comments