@@ -98,39 +98,34 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
98
98
}
99
99
100
100
func polymorphicQuery< ReturnedType: PolymorphicOperationReturnType > ( forPartitionKey partitionKey: String ,
101
- sortKeyCondition: AttributeCondition ? ,
102
- consistentRead: Bool ) async throws
101
+ sortKeyCondition: AttributeCondition ? ) async throws
103
102
-> [ ReturnedType ]
104
103
{
105
104
try await self . polymorphicPartialQuery ( forPartitionKey: partitionKey,
106
105
sortKeyCondition: sortKeyCondition,
107
- exclusiveStartKey: nil ,
108
- consistentRead: consistentRead)
106
+ exclusiveStartKey: nil )
109
107
}
110
108
111
109
// function to return a future with the results of a query call and all future paginated calls
112
110
private func polymorphicPartialQuery< ReturnedType: PolymorphicOperationReturnType > (
113
111
forPartitionKey partitionKey: String ,
114
112
sortKeyCondition: AttributeCondition ? ,
115
- exclusiveStartKey: String ? ,
116
- consistentRead: Bool ) async throws -> [ ReturnedType ]
113
+ exclusiveStartKey: String ? ) async throws -> [ ReturnedType ]
117
114
{
118
115
let paginatedItems : ( [ ReturnedType ] , String ? ) =
119
116
try await polymorphicQuery ( forPartitionKey: partitionKey,
120
117
sortKeyCondition: sortKeyCondition,
121
118
limit: nil ,
122
119
scanIndexForward: true ,
123
- exclusiveStartKey: exclusiveStartKey,
124
- consistentRead: consistentRead)
120
+ exclusiveStartKey: exclusiveStartKey)
125
121
126
122
// if there are more items
127
123
if let lastEvaluatedKey = paginatedItems. 1 {
128
124
// returns a future with all the results from all later paginated calls
129
125
let partialResult : [ ReturnedType ] = try await self . polymorphicPartialQuery (
130
126
forPartitionKey: partitionKey,
131
127
sortKeyCondition: sortKeyCondition,
132
- exclusiveStartKey: lastEvaluatedKey,
133
- consistentRead: consistentRead)
128
+ exclusiveStartKey: lastEvaluatedKey)
134
129
135
130
// return the results from 'this' call and all later paginated calls
136
131
return paginatedItems. 0 + partialResult
@@ -143,32 +138,29 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
143
138
func polymorphicQuery< ReturnedType: PolymorphicOperationReturnType > ( forPartitionKey partitionKey: String ,
144
139
sortKeyCondition: AttributeCondition ? ,
145
140
limit: Int ? ,
146
- exclusiveStartKey: String ? ,
147
- consistentRead: Bool ) async throws
141
+ exclusiveStartKey: String ? ) async throws
148
142
-> ( items: [ ReturnedType ] , lastEvaluatedKey: String ? )
149
143
{
150
144
try await self . polymorphicQuery ( forPartitionKey: partitionKey,
151
145
sortKeyCondition: sortKeyCondition,
152
146
limit: limit,
153
147
scanIndexForward: true ,
154
- exclusiveStartKey: exclusiveStartKey,
155
- consistentRead: consistentRead)
148
+ exclusiveStartKey: exclusiveStartKey)
156
149
}
157
150
158
151
func polymorphicQuery< ReturnedType: PolymorphicOperationReturnType > ( forPartitionKey partitionKey: String ,
159
152
sortKeyCondition: AttributeCondition ? ,
160
153
limit: Int ? ,
161
154
scanIndexForward: Bool ,
162
- exclusiveStartKey: String ? ,
163
- consistentRead: Bool ) async throws
155
+ exclusiveStartKey: String ? ) async throws
164
156
-> ( items: [ ReturnedType ] , lastEvaluatedKey: String ? )
165
157
{
166
158
let queryInput = try AWSDynamoDB . QueryInput. forSortKeyCondition ( partitionKey: partitionKey, targetTableName: targetTableName,
167
159
primaryKeyType: ReturnedType . AttributesType. self,
168
160
sortKeyCondition: sortKeyCondition, limit: limit,
169
161
scanIndexForward: scanIndexForward,
170
162
exclusiveStartKey: exclusiveStartKey,
171
- consistentRead: consistentRead)
163
+ consistentRead: self . tableConfiguration . consistentRead)
172
164
173
165
let logMessage = " dynamodb.query with partitionKey: \( partitionKey) , " +
174
166
" sortKeyCondition: \( sortKeyCondition. debugDescription) , and table name \( targetTableName) . "
@@ -232,39 +224,34 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
232
224
}
233
225
234
226
func query< AttributesType, ItemType, TimeToLiveAttributesType> ( forPartitionKey partitionKey: String ,
235
- sortKeyCondition: AttributeCondition ? ,
236
- consistentRead: Bool ) async throws
227
+ sortKeyCondition: AttributeCondition ? ) async throws
237
228
-> [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ]
238
229
{
239
230
try await self . partialQuery ( forPartitionKey: partitionKey,
240
231
sortKeyCondition: sortKeyCondition,
241
- exclusiveStartKey: nil ,
242
- consistentRead: consistentRead)
232
+ exclusiveStartKey: nil )
243
233
}
244
234
245
235
// function to return a future with the results of a query call and all future paginated calls
246
236
private func partialQuery< AttributesType, ItemType, TimeToLiveAttributesType> (
247
237
forPartitionKey partitionKey: String ,
248
238
sortKeyCondition: AttributeCondition ? ,
249
- exclusiveStartKey _: String ? ,
250
- consistentRead: Bool ) async throws -> [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ]
239
+ exclusiveStartKey _: String ? ) async throws -> [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ]
251
240
{
252
241
let paginatedItems : ( [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ] , String ? ) =
253
242
try await query ( forPartitionKey: partitionKey,
254
243
sortKeyCondition: sortKeyCondition,
255
244
limit: nil ,
256
245
scanIndexForward: true ,
257
- exclusiveStartKey: nil ,
258
- consistentRead: consistentRead)
246
+ exclusiveStartKey: nil )
259
247
260
248
// if there are more items
261
249
if let lastEvaluatedKey = paginatedItems. 1 {
262
250
// returns a future with all the results from all later paginated calls
263
251
let partialResult : [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ] = try await self . partialQuery (
264
252
forPartitionKey: partitionKey,
265
253
sortKeyCondition: sortKeyCondition,
266
- exclusiveStartKey: lastEvaluatedKey,
267
- consistentRead: consistentRead)
254
+ exclusiveStartKey: lastEvaluatedKey)
268
255
269
256
// return the results from 'this' call and all later paginated calls
270
257
return paginatedItems. 0 + partialResult
@@ -278,16 +265,15 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
278
265
sortKeyCondition: AttributeCondition ? ,
279
266
limit: Int ? ,
280
267
scanIndexForward: Bool ,
281
- exclusiveStartKey: String ? ,
282
- consistentRead: Bool ) async throws
268
+ exclusiveStartKey: String ? ) async throws
283
269
-> ( items: [ TypedTTLDatabaseItem < AttributesType , ItemType , TimeToLiveAttributesType > ] , lastEvaluatedKey: String ? )
284
270
{
285
271
let queryInput = try AWSDynamoDB . QueryInput. forSortKeyCondition (
286
272
partitionKey: partitionKey, targetTableName: targetTableName,
287
273
primaryKeyType: AttributesType . self,
288
274
sortKeyCondition: sortKeyCondition, limit: limit,
289
275
scanIndexForward: scanIndexForward, exclusiveStartKey: exclusiveStartKey,
290
- consistentRead: consistentRead)
276
+ consistentRead: self . tableConfiguration . consistentRead)
291
277
292
278
let logMessage = " dynamodb.query with partitionKey: \( partitionKey) , " +
293
279
" sortKeyCondition: \( sortKeyCondition. debugDescription) , and table name \( targetTableName) . "
0 commit comments