Add Supported Format Discovery
Goal
Expose ROFSDB supported file extensions so consumers can discover which formats are registered in the current service provider.
Repository Context
ROFSDB discovers registered serializers by resolving keyed ISerialization services and building an extension-to-serializer map inside DatabaseEngine. That information is currently internal to DatabaseEngine, so consumers cannot inspect supported extensions without duplicating DI logic.
Implementation Guidance
- Add a small public discovery abstraction, such as
IFileFormatRegistry, rather than expanding IDatabaseEngine unless there is a clear compatibility reason.
- Populate the registry from registered keyed
ISerialization services.
- Expose supported extensions and, if useful, serializer display names.
- Normalize extensions with a leading dot.
- Use case-insensitive extension handling consistent with
DatabaseEngine.
- Register the registry in
ServiceCollectionExtensions.
- Consider sharing the registry with
DatabaseEngine to avoid duplicating extension-map construction.
- Preserve existing
IDatabaseEngine behavior.
Test Requirements
- Assert the registry reports all built-in extensions.
- Assert extension matching is case-insensitive.
- Assert custom serializers registered by users appear in the registry.
- Assert duplicate extension handling follows the repository's chosen duplicate-registration behavior.
Acceptance Criteria
- Consumers can query supported extensions through DI.
- Existing document reading behavior remains unchanged.
- The feature works with custom serializers.
dotnet test passes.
Add Supported Format Discovery
Goal
Expose ROFSDB supported file extensions so consumers can discover which formats are registered in the current service provider.
Repository Context
ROFSDB discovers registered serializers by resolving keyed
ISerializationservices and building an extension-to-serializer map insideDatabaseEngine. That information is currently internal toDatabaseEngine, so consumers cannot inspect supported extensions without duplicating DI logic.Implementation Guidance
IFileFormatRegistry, rather than expandingIDatabaseEngineunless there is a clear compatibility reason.ISerializationservices.DatabaseEngine.ServiceCollectionExtensions.DatabaseEngineto avoid duplicating extension-map construction.IDatabaseEnginebehavior.Test Requirements
Acceptance Criteria
dotnet testpasses.