Check Existing Issues
Problem Description
The storage adapters have drifted apart in behavior, so swapping StorageAdapterType changes results in ways callers don't expect. Three concrete parity gaps:
1. DynamoDB List ignores sort direction (storage/dynamodb.go:250-269).
It applies ORDER BY %s from sortKey but never reads/applies a sort-direction param, so results are always ascending. CosmosDB, by contrast, extracts and applies it (storage/cosmosdb.go uses extractSortDirection).
2. CosmosDB Search ignores its query argument (storage/cosmosdb.go:485).
// Use executePaginatedQuery with empty filter (the query parameter is ignored for CosmosDB)
return s.executePaginatedQuery(ctx, dest, sortKey, sortDirection, limit, cursor, map[string]any{}, params...)
Search silently degrades to an unfiltered List. The method signature promises search but does not deliver it.
3. DynamoDB GetProvider() / GetSchemaName() return empty strings (storage/dynamodb.go:99-105).
func (s *DynamoDBAdapter) GetProvider() StorageProviders { return "" }
func (s *DynamoDBAdapter) GetSchemaName() string { return "" }
Other adapters return a real provider; the empty string degrades anything keying off provider (e.g. telemetry/metric labels in observability/storage_metrics.go).
Desired Solution you'd like
- DynamoDB
List: extract and apply sort direction the same way Cosmos/SQL do.
- CosmosDB
Search: either implement query filtering, or return an explicit "search not supported" error rather than silently behaving like List.
- DynamoDB: return a real
StorageProviders value (e.g. a DYNAMODB provider constant) so telemetry labels are correct.
Define and document the cross-adapter contract for List/Search/GetProvider so future adapters conform.
Additional Context
Found during a general audit of the library. Labeled help wanted since closing all three cleanly touches the adapter interface contract, not just one method.
Check Existing Issues
Problem Description
The storage adapters have drifted apart in behavior, so swapping
StorageAdapterTypechanges results in ways callers don't expect. Three concrete parity gaps:1. DynamoDB
Listignores sort direction (storage/dynamodb.go:250-269).It applies
ORDER BY %sfromsortKeybut never reads/applies a sort-direction param, so results are always ascending. CosmosDB, by contrast, extracts and applies it (storage/cosmosdb.gousesextractSortDirection).2. CosmosDB
Searchignores its query argument (storage/cosmosdb.go:485).Searchsilently degrades to an unfilteredList. The method signature promises search but does not deliver it.3. DynamoDB
GetProvider()/GetSchemaName()return empty strings (storage/dynamodb.go:99-105).Other adapters return a real provider; the empty string degrades anything keying off provider (e.g. telemetry/metric labels in
observability/storage_metrics.go).Desired Solution you'd like
List: extract and apply sort direction the same way Cosmos/SQL do.Search: either implement query filtering, or return an explicit "search not supported" error rather than silently behaving likeList.StorageProvidersvalue (e.g. aDYNAMODBprovider constant) so telemetry labels are correct.Define and document the cross-adapter contract for
List/Search/GetProviderso future adapters conform.Additional Context
Found during a general audit of the library. Labeled
help wantedsince closing all three cleanly touches the adapter interface contract, not just one method.