|
@@ -113,7 +113,9 @@ Result<int64_t> StorageClient::update(const std::string& collection,
|
|
|
}
|
|
}
|
|
|
bool ok = impl_->client_->update(collection, id, data);
|
|
bool ok = impl_->client_->update(collection, id, data);
|
|
|
if (!ok) return Error(ErrorCode::DatabaseError, "Update failed: " + collection + "/" + id);
|
|
if (!ok) return Error(ErrorCode::DatabaseError, "Update failed: " + collection + "/" + id);
|
|
|
- return 0;
|
|
|
|
|
|
|
+ // Upstream plain update() returns bool only; the new version is not exposed.
|
|
|
|
|
+ // Use -1 to signal "version unknown" so callers cannot mistake it for version 0.
|
|
|
|
|
+ return -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Result<void> StorageClient::remove(const std::string& collection,
|
|
Result<void> StorageClient::remove(const std::string& collection,
|
|
@@ -121,7 +123,7 @@ Result<void> StorageClient::remove(const std::string& collection,
|
|
|
int64_t expected_version) {
|
|
int64_t expected_version) {
|
|
|
(void)expected_version; // upstream remove() is unconditional in 1.7.x
|
|
(void)expected_version; // upstream remove() is unconditional in 1.7.x
|
|
|
bool ok = impl_->client_->remove(collection, id);
|
|
bool ok = impl_->client_->remove(collection, id);
|
|
|
- if (!ok) return Error(ErrorCode::DocumentNotFound, "Remove failed: " + collection + "/" + id);
|
|
|
|
|
|
|
+ if (!ok) return Error(ErrorCode::DatabaseError, "Remove failed: " + collection + "/" + id);
|
|
|
return {};
|
|
return {};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -176,7 +178,7 @@ Result<void> StorageClient::createCollection(const std::string& name,
|
|
|
/*encrypted=*/false,
|
|
/*encrypted=*/false,
|
|
|
maxVersions,
|
|
maxVersions,
|
|
|
/*vectorDimension=*/0);
|
|
/*vectorDimension=*/0);
|
|
|
- if (!ok) return Error(ErrorCode::CollectionNotFound, "createCollection failed: " + name);
|
|
|
|
|
|
|
+ if (!ok) return Error(ErrorCode::DatabaseError, "createCollection failed: " + name);
|
|
|
return {};
|
|
return {};
|
|
|
}
|
|
}
|
|
|
|
|
|