Part of the Cosmos DB Go SDK v2 (azcosmos/v2) effort, which binds the Go data plane to the shared Rust Cosmos driver over the C ABI (decision: #27238).
The gap
ReadConsistencyStrategy::LatestCommitted is reachable from the Rust SDK but cannot cross the C ABI, so it cannot be offered by any SDK bound through the native layer — Go included.
The driver defines it:
// azure_data_cosmos_driver/src/options/read_consistency.rs
pub enum ReadConsistencyStrategy {
Default,
Eventual,
Session,
LatestCommitted,
GlobalStrong,
}
and the Rust SDK re-exports the enum wholesale, so it is on that SDK's public surface:
// azure_data_cosmos/src/options/mod.rs
pub use azure_data_cosmos_driver::options::{
..., ReadConsistencyStrategy, Region, ...
};
But the C ABI's mirror of the enum has no discriminant for it:
COSMOS_READ_CONSISTENCY_STRATEGY_UNSET = 0, /* inherit */
COSMOS_READ_CONSISTENCY_STRATEGY_DEFAULT = 1,
COSMOS_READ_CONSISTENCY_STRATEGY_EVENTUAL = 2,
COSMOS_READ_CONSISTENCY_STRATEGY_SESSION = 3,
COSMOS_READ_CONSISTENCY_STRATEGY_GLOBAL_STRONG = 4,
So a Rust application can request latest-committed reads and a Go one cannot, purely because of where the boundary sits.
Why it matters
This is a cross-SDK parity gap rather than a Go omission. Any SDK bound through azure_data_cosmos_driver_native — Go, and the .NET/Java/Python bindings that follow — inherits it. Go v2's ReadConsistencyStrategy currently covers all five ABI values and stops there.
What needs deciding
One of two things, and it is the driver crew's call which:
- Add a discriminant for latest-committed to
CosmosReadConsistencyStrategy in the C ABI, so bound SDKs can express it. This is the option that closes the gap.
- Stop re-exporting it from the Rust SDK, if it was never meant to be public there. The wholesale
pub use of the driver enum suggests its exposure may be incidental rather than deliberate.
Worth confirming which was intended before Go v2's API is signed off (#27306), since the answer determines whether the Go surface is complete or knowingly short by one value.
References
- Go v2 surface:
sdk/data/azcosmos/read_consistency_strategy.go
- Header read at
Azure/azure-sdk-for-rust commit a080bf7511
Part of the Cosmos DB Go SDK v2 (
azcosmos/v2) effort, which binds the Go data plane to the shared Rust Cosmos driver over the C ABI (decision: #27238).The gap
ReadConsistencyStrategy::LatestCommittedis reachable from the Rust SDK but cannot cross the C ABI, so it cannot be offered by any SDK bound through the native layer — Go included.The driver defines it:
and the Rust SDK re-exports the enum wholesale, so it is on that SDK's public surface:
But the C ABI's mirror of the enum has no discriminant for it:
So a Rust application can request latest-committed reads and a Go one cannot, purely because of where the boundary sits.
Why it matters
This is a cross-SDK parity gap rather than a Go omission. Any SDK bound through
azure_data_cosmos_driver_native— Go, and the .NET/Java/Python bindings that follow — inherits it. Go v2'sReadConsistencyStrategycurrently covers all five ABI values and stops there.What needs deciding
One of two things, and it is the driver crew's call which:
CosmosReadConsistencyStrategyin the C ABI, so bound SDKs can express it. This is the option that closes the gap.pub useof the driver enum suggests its exposure may be incidental rather than deliberate.Worth confirming which was intended before Go v2's API is signed off (#27306), since the answer determines whether the Go surface is complete or knowingly short by one value.
References
sdk/data/azcosmos/read_consistency_strategy.goAzure/azure-sdk-for-rustcommita080bf7511