Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom LINQ engine #112

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Custom LINQ engine #112

wants to merge 18 commits into from

Conversation

Turnerj
Copy link
Member

@Turnerj Turnerj commented Nov 5, 2019

This kick starts the work for #87

@Turnerj Turnerj added enhancement Enhancements & features affects-querying Query-related issue major-change Major changes required labels Nov 5, 2019
@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #112 into master will decrease coverage by 4.67%.
The diff coverage is 60.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
- Coverage   91.74%   87.07%   -4.68%     
==========================================
  Files          71       78       +7     
  Lines        2496     2932     +436     
  Branches      294      348      +54     
==========================================
+ Hits         2290     2553     +263     
- Misses        134      286     +152     
- Partials       72       93      +21
Impacted Files Coverage Δ
...ure/Mapping/Processors/PropertyMappingProcessor.cs 84.21% <0%> (-5.27%) ⬇️
...e/Linq/Translation/Translators/SelectTranslator.cs 10.71% <10.71%> (ø)
...rastructure/Linq/Translation/DefaultTranslators.cs 100% <100%> (ø)
...re/Linq/Translation/Translators/WhereTranslator.cs 100% <100%> (ø)
.../Linq/Translation/Translators/OrderByTranslator.cs 16.66% <16.66%> (ø)
...rk/Infrastructure/Linq/Translation/StageBuilder.cs 45.45% <45.45%> (ø)
...tructure/Linq/Translation/ExpressionTranslation.cs 66.47% <66.47%> (ø)
...frastructure/Linq/Translation/TranslationHelper.cs 71.42% <71.42%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80dd893...dceb2db. Read the comment docs.

@Turnerj
Copy link
Member Author

Turnerj commented Aug 14, 2020

Of note, attempt to support $lookup through custom LINQ engine. This would effectively add support for basic joins between collections.

@Turnerj Turnerj added this to the 1.0.0 milestone Aug 17, 2020
@Turnerj
Copy link
Member Author

Turnerj commented Dec 10, 2020

The process now will be to add the "low hanging fruit" queries like GroupBy etc, then write translators for GeoNear and Text search. Once done, we remove the pre-stage logic as it all will be handled by the new LINQ translator system. The updated GetExecutionModel logic will no longer do any reflection and will retrieve the correct serializer by its own method.

At this point, it is just a matter of weeding out the existing tests to pass, then making sure that each component is adequately tested itself.

Once this is done, the next wave of changes will be writing an optimization layer for queries. This will be done directly with the BsonDocument where it should be easier than with expressions.

Kickstarts #87 though a ton more work is needed
Tries to standardise behind one "MethodParser" system. Adds a whole bunch of parsing logic for many types of expressions.

Major things to do:
- Support projection ("new BlahBlah" as well as properties)
- Support groupby
- Support ThenOrderBy (though will need a post-processor or something to group statements unless I un-standardise it and have no queries-within-queries - I mean, I probably don't want that anyway)
PropertyMappingProcessor needed to ignore CanWrite so the properties can be picked up for anonymous types.
Second (or third, depending how you count it) of building an expression system base.

Supports custom method, member and even expression type translators.
Negating "AndAlso" isn't the same as negating an "OrElse". The "OrElse" can use a "$nor" whereas the "AndAlso" needs to have the individual operations use "$not" around their operator expression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-querying Query-related issue enhancement Enhancements & features major-change Major changes required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant