Skip to content
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
18 changes: 9 additions & 9 deletions Sources/CodableDatastore/Datastore/Datastore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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 {
Expand Down Expand Up @@ -515,7 +515,7 @@ extension Datastore {
}

try await self.persistence._withTransaction(
actionName: nil,
actionName: "Load \(self.key) ID Range",
options: [.readOnly]
) { transaction, _ in
do {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions Sources/CodableDatastore/Datastore/DatastoreKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ extension DatastoreKey: Encodable {
try container.encode(rawValue)
}
}

extension DatastoreKey: CustomStringConvertible {
@inlinable
public var description: String { rawValue }
}
4 changes: 4 additions & 0 deletions Sources/CodableDatastore/Indexes/IndexName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ extension IndexName: Encodable {
try container.encode(rawValue)
}
}

extension IndexName: CustomStringConvertible {
public var description: String { rawValue }
}