Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By attaching a
SQL
cache to executed queries it becomes possible to skip a lot of processing especially for more complex queries. Therefor this PR introduces the initial setup for creating and leveraging re usableCQN
queriesSQL
caches.Currently in most writing queries
resolveView
is used to be able to write into entities that cannot be written into directly on the database. The big drawback of theresolveView
usage is that it does not just modify the query, but also modifies the attached data. Therefor this PR also removes the earlyresolveView
and leverages thegetTransitions
andgetDBTable
functions instead to bake the data transformation directly into the SQL statements. This mostly comes down to defining different column names in theSQL
from theJSON
properties send to the database service.Allowing the caching mechanism to simply re-use the
SQL
produced before and serializing the newentries
. Without having to callresolveView
on each call even when cached.There is a clear problem by having the caching mechanism be added on the lowest level. Is that currently many applications will be relying on directly modifying
CQN
without callingcds.ql.clone
orq.clone
which is now required to receive the expected results. Asclone
will invalidate anySQL
cache on theproto
query.Additionally the remove of
resolveView
allows for proper adoption ofIterator
andReadable
insert sources. As implemented by: #844