From 4d5fde9083d9abb1559ee7cb6dbcfd783914414a Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Tue, 23 Dec 2025 04:34:26 -0800 Subject: [PATCH 1/3] Updated `DatastoreKey` to be `CustomStringConvertible` --- Sources/CodableDatastore/Datastore/DatastoreKey.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/CodableDatastore/Datastore/DatastoreKey.swift b/Sources/CodableDatastore/Datastore/DatastoreKey.swift index 68cc4a2..02d9fa4 100644 --- a/Sources/CodableDatastore/Datastore/DatastoreKey.swift +++ b/Sources/CodableDatastore/Datastore/DatastoreKey.swift @@ -41,3 +41,8 @@ extension DatastoreKey: Encodable { try container.encode(rawValue) } } + +extension DatastoreKey: CustomStringConvertible { + @inlinable + public var description: String { rawValue } +} From 8310f4b2fbe463a4cbee0336290ebb4ad1aec651 Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Tue, 23 Dec 2025 04:34:35 -0800 Subject: [PATCH 2/3] Updated `IndexName` to be `CustomStringConvertible` --- Sources/CodableDatastore/Indexes/IndexName.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/CodableDatastore/Indexes/IndexName.swift b/Sources/CodableDatastore/Indexes/IndexName.swift index f4dfb71..2c85359 100644 --- a/Sources/CodableDatastore/Indexes/IndexName.swift +++ b/Sources/CodableDatastore/Indexes/IndexName.swift @@ -42,3 +42,7 @@ extension IndexName: Encodable { try container.encode(rawValue) } } + +extension IndexName: CustomStringConvertible { + public var description: String { rawValue } +} From 89003e946918241a929b9d46ee0f18a304c2fe28 Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Tue, 23 Dec 2025 04:40:03 -0800 Subject: [PATCH 3/3] Added action names for all implicit transactions --- .../CodableDatastore/Datastore/Datastore.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/CodableDatastore/Datastore/Datastore.swift b/Sources/CodableDatastore/Datastore/Datastore.swift index 96b995d..56b715c 100644 --- a/Sources/CodableDatastore/Datastore/Datastore.swift +++ b/Sources/CodableDatastore/Datastore/Datastore.swift @@ -165,7 +165,7 @@ extension Datastore { } let warmupTask = Task { try await persistence._withTransaction( - actionName: "Migrate Entries", + actionName: "Migrate \(key) Instances", options: [] ) { transaction, _ in try await self.registerAndMigrate(with: transaction) @@ -382,7 +382,7 @@ extension Datastore where AccessMode == ReadWrite { let indexRepresentation = AnyIndexRepresentation(indexRepresentation: self.format[keyPath: index]) try await persistence._withTransaction( - actionName: "Migrate Entries", + actionName: "Migrate \(key) Instances", options: [] ) { transaction, _ in guard @@ -460,7 +460,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: "Check Count", + actionName: "Check \(key) Count", options: [.idempotent, .readOnly] ) { transaction, _ in let descriptor = try await transaction.datastoreDescriptor(for: self.key) @@ -476,7 +476,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: nil, + actionName: "Load \(key) ID", options: [.idempotent, .readOnly] ) { transaction, _ in do { @@ -515,7 +515,7 @@ extension Datastore { } try await self.persistence._withTransaction( - actionName: nil, + actionName: "Load \(self.key) ID Range", options: [.readOnly] ) { transaction, _ in do { @@ -602,7 +602,7 @@ extension Datastore { try await self.warmupIfNeeded() try await self.persistence._withTransaction( - actionName: nil, + actionName: "Load \(self.key) \(declaredIndex.indexName)", options: [.readOnly] ) { transaction, _ in do { @@ -753,7 +753,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: nil, + actionName: "Start \(key) Observations", options: [.idempotent, .readOnly] ) { transaction, _ in try await transaction.makeObserver( @@ -791,7 +791,7 @@ extension Datastore where AccessMode == ReadWrite { let instanceData = try await self.encoder(instance) return try await persistence._withTransaction( - actionName: "Persist Entry", + actionName: "Persist \(key) Instance", options: [.idempotent] ) { transaction, _ in /// Create any missing indexes or prime the datastore for writing. @@ -977,7 +977,7 @@ extension Datastore where AccessMode == ReadWrite { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: "Delete Entry", + actionName: "Delete \(key) Instance", options: [.idempotent] ) { transaction, _ in /// Get a cursor to the entry within the primary index.