devlooped / devlooped/TableStorage
When using document-based storage, allow projecting certain properties to columns
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 27
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
This could be handy to allow querying by those columns in particular.
So maybe it could be via an implemented interface that's then used when creating the repository? For example: DocumentRepository.Create<Book, IAddressable>()?
public static IDocumentRepository<T> Create<T, TProperties>(...)
where T: class, TProperties
where TProperties: IDocumentEntity
Where the returned document repository augmented IDocumentRepository<T> with the ability to perform queries, such as:
public interface IDocumentRepository<T, TProperties> : IDocumentRepository<T>
where T : class, TProperties
{
IAsyncEnumerable<T> CreateQuery(Expression<Func<TProperties, bool>> predicate, CancellationToken cancellation = default);
}
Note that unlike table repository IQueryable<T> CreateQuery() version, we need to restrict the available properties for querying to the TProperties since not all T properties will be available as columns. So using an expression for the properties and an async enumerable with the full entity type seems the most natural.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the document repository creation API and the table repository CreateQuery implementation mentioned in the issue. Compare how repository capabilities are exposed, then determine how projected properties and the proposed constrained async query would fit. Done means the design is settled and document storage supports querying the selected properties as columns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100
