Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, adjust for changes in aws-sdk-swift. #20

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/awslabs/aws-sdk-swift.git",
"state" : {
"revision" : "22ac271a961d9c8cec2308bf853f773c04146260",
"version" : "0.44.0"
"revision" : "14da8fcf13246e4f46cadc7a5ce291d839f3225d",
"version" : "0.45.0"
}
},
{
Expand All @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/smithy-lang/smithy-swift",
"state" : {
"revision" : "c9caeb7c2df39ac0d4d4c6182c40426b7ec4485a",
"version" : "0.49.0"
"revision" : "a30764bf83af6876a3956aa394c838dcf2975cb3",
"version" : "0.50.0"
}
},
{
Expand All @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/nicklockwood/SwiftFormat",
"state" : {
"revision" : "4bf475154c1c98dcdf751037f930f8e5c72597a4",
"version" : "0.53.10"
"revision" : "dd989a46d0c6f15c016484bab8afe5e7a67a4022",
"version" : "0.54.0"
}
}
],
Expand Down
11 changes: 8 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

import PackageDescription

let swiftSettings: [SwiftSetting] = [.enableExperimentalFeature("StrictConcurrency=complete"),
]

let package = Package(
name: "dynamo-db-tables",
platforms: [
Expand All @@ -34,7 +37,7 @@ let package = Package(
targets: ["DynamoDBTables"]),
],
dependencies: [
.package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.40.0"),
.package(url: "https://github.com/awslabs/aws-sdk-swift.git", from: "0.45.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
.package(url: "https://github.com/JohnSundell/CollectionConcurrencyKit", from :"0.2.0"),
Expand All @@ -47,11 +50,13 @@ let package = Package(
.product(name: "Metrics", package: "swift-metrics"),
.product(name: "AWSDynamoDB", package: "aws-sdk-swift"),
.product(name: "CollectionConcurrencyKit", package: "CollectionConcurrencyKit"),
]),
],
swiftSettings: swiftSettings),
.testTarget(
name: "DynamoDBTablesTests", dependencies: [
.target(name: "DynamoDBTables"),
]),
],
swiftSettings: swiftSettings),
],
swiftLanguageVersions: [.v5]
)
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ public extension AWSDynamoDBCompositePrimaryKeyTable {
isTransactionConflict = true

return DynamoDBTableError.transactionConflict(message: cancellationReason.message)

case "ProvisionedThroughputExceeded":
return DynamoDBTableError.transactionProvisionedThroughputExceeded(message: cancellationReason.message)
case "ThrottlingError":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
// DynamoDBTables
//

import AWSClientRuntime
import AwsCommonRuntimeKit
import AWSDynamoDB
import ClientRuntime
import Foundation
import Logging
import Metrics
import SmithyIdentityAPI

public struct AWSDynamoDBTableMetrics {
// metric to record if the `TransactWrite` API is retried
Expand All @@ -51,7 +51,7 @@ public struct AWSDynamoDBCompositePrimaryKeyTable: DynamoDBCompositePrimaryKeyTa
let logger: Logging.Logger

public init(tableName: String, region: Swift.String,
awsCredentialIdentityResolver: (any AWSClientRuntime.AWSCredentialIdentityResolver)? = nil,
awsCredentialIdentityResolver: (any SmithyIdentityAPI.AWSCredentialIdentityResolver)? = nil,
httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil,
consistentRead: Bool = true,
escapeSingleQuoteInPartiQL: Bool = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
// DynamoDBTables
//

import AWSClientRuntime
import AwsCommonRuntimeKit
import AWSDynamoDB
import ClientRuntime
import Foundation
import Logging
import SmithyIdentityAPI

public struct AWSDynamoDBCompositePrimaryKeysProjection: DynamoDBCompositePrimaryKeysProjection {
let dynamodb: AWSDynamoDB.DynamoDBClient
Expand All @@ -42,7 +42,7 @@ public struct AWSDynamoDBCompositePrimaryKeysProjection: DynamoDBCompositePrimar
}

public init(tableName: String, region: Swift.String,
awsCredentialIdentityResolver: (any AWSClientRuntime.AWSCredentialIdentityResolver)? = nil,
awsCredentialIdentityResolver: (any SmithyIdentityAPI.AWSCredentialIdentityResolver)? = nil,
httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil,
logger: Logging.Logger? = nil) throws
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Code generated by smithy-swift-codegen. DO NOT EDIT!
// swiftlint:disable identifier_name cyclomatic_complexity function_body_length

import AWSClientRuntime
import AWSDynamoDB
import ClientRuntime
import Foundation

public struct Key: CodingKey {
public let stringValue: String
Expand Down Expand Up @@ -93,7 +93,7 @@ extension DynamoDBClientTypes.AttributeValue: Swift.Codable {
self = .n(n)
return
}
let bDecoded = try values.decodeIfPresent(ClientRuntime.Data.self, forKey: .b)
let bDecoded = try values.decodeIfPresent(Foundation.Data.self, forKey: .b)
if let b = bDecoded {
self = .b(b)
return
Expand Down Expand Up @@ -126,10 +126,10 @@ extension DynamoDBClientTypes.AttributeValue: Swift.Codable {
self = .ns(ns)
return
}
let bsContainer = try values.decodeIfPresent([ClientRuntime.Data?].self, forKey: .bs)
var bsDecoded0: [ClientRuntime.Data]? = nil
let bsContainer = try values.decodeIfPresent([Foundation.Data?].self, forKey: .bs)
var bsDecoded0: [Foundation.Data]? = nil
if let bsContainer {
bsDecoded0 = [ClientRuntime.Data]()
bsDecoded0 = [Foundation.Data]()
for blob0 in bsContainer {
if let blob0 {
bsDecoded0?.append(blob0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests: XCTestCase {

for _ in 0 ..< 10 {
let query: [ExpectedQueryableTypes] = try await table.query(forPartitionKey: "partitionId",
sortKeyCondition: .equals("sortId"))
sortKeyCondition: .equals("sortId"))

guard query.count == 1, case let .testTypeA(firstDatabaseItem) = query[0] else {
return XCTFail("Expected to retrieve item and there wasn't the correct number or type.")
Expand Down Expand Up @@ -174,7 +174,7 @@ class SimulateConcurrencyDynamoDBCompositePrimaryKeyTableTests: XCTestCase {

for _ in 0 ..< 10 {
let query: [DatabaseRowType] = try await table.monomorphicQuery(forPartitionKey: "partitionId",
sortKeyCondition: .equals("sortId"))
sortKeyCondition: .equals("sortId"))

guard query.count == 1, let firstQuery = query.first else {
return XCTFail("Expected to retrieve item and there wasn't the correct number or type.")
Expand Down
Loading