Description
Hello, I'd like to request the addition of a public API that exposes a map of table types to their corresponding table instances.
The goal is to allow users to easily access the registered tables in a structured and type-safe way. Ideally, it would look something like:
Map<Type, Table> get tables => UnmodifiableMap({...});
This would provide direct visibility into which tables are available, and grant access to their instances without needing to access the whole db instance.
Motivations
There are several scenarios where this feature would be highly beneficial:
- It enables building abstractions that selectively expose one or more tables to other components or service classes.
- It simplifies dependency injection patterns, where consumers only require access to specific tables.
In my specific use case, I want to create a service layer that only exposes specific tables to each service, based on the logic of that layer. Having a Map<Type, Table> would make this both safe and elegant.
Description
Hello, I'd like to request the addition of a public API that exposes a map of table types to their corresponding table instances.
The goal is to allow users to easily access the registered tables in a structured and type-safe way. Ideally, it would look something like:
This would provide direct visibility into which tables are available, and grant access to their instances without needing to access the whole db instance.
Motivations
There are several scenarios where this feature would be highly beneficial:
In my specific use case, I want to create a service layer that only exposes specific tables to each service, based on the logic of that layer. Having a
Map<Type, Table>would make this both safe and elegant.