-
Notifications
You must be signed in to change notification settings - Fork 132
Add Query-Pre-Processor #46
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
Comments
Should this be implemented at compile time or at runtime? Sorry if it is a stupid question. |
There’s no such thing as a stupid question. We want to provide a runtime API so code can intercept and modify queries prior to execution. |
Got it. What kind of modifications? Optimizations? I'm so curious. |
You can use it to generate events, modify the query to e.g. implement security requirements, implement multi-tenancy, add generic query predicates. |
Does this also support transparent routing of all queries to |
Not sure this is applicable. If you’re using a database setup that supports primary/replica routing, then this would be the right place. Typically, command routing is rather a NoSql datastore feature.
Am 20. Jan. 2019, 15:47 +0100 schrieb Ashok Koyi <[email protected]>:
… Does this also support transparent routing of all queries to read/replica server and all CUDs to write/primary server
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@mp911de is this still required? I could take a look into it. |
I think this ticket requires some design up-front. Looking into Spring 5's |
#73 brings |
I am migrating from a non reactive to a reactive app. I have a requirement to update all my queries with a custom value, where I replace some pattern like
What would be the correct approach for this with DatabaseClient? I assume a common query preprocessor would be a solution for this. |
Ideally, intercept calls execute with a custom DatabaseClient implementation that just pre-processes your sql. |
Tried doing that. Found it complicated that I had to implement all the GenericExecuteSpec, SelectFromSpec etc, for simply doing a query preprocessor. |
Any update on if this is gonna be implemented soon? I need to add a filter like " AND someCode IN (A,B,C)" to all my queries and there's 100's of them. It would be really helpful if there was a simple way of achieving this 3-4 years after this ticket was created? |
The most straightforward workaround is to provide a |
Do I need to use AOP for intercepting the sql(…) method of DatabaseClient? We have mostly used ReactiveCrudRepository in the DAO where we use both the @query annotation and method name for generating the query but I can use the same DatabaseClient implementation for the Repository by defining a bean of type R2dbcEntityOperations. If you could provide some hint on how can I intercept the sql() method then that will be highly appreciated. Thanks In Advance. |
We should consider adding a Query Pre-Processor API that allows generic pre-processing of queries. The first use-case of query-pre-processing is named parameter expansion (see #23). Another case can be generic query augmentation to add or remove parts of a query and to mutate bound parameters. Query pre-processors can be modeled as a filter function to compose a chain of functions.
The text was updated successfully, but these errors were encountered: