-
Notifications
You must be signed in to change notification settings - Fork 132
execute(...) should be extended with returning generated keys #189
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
This ticket is related to #46 as we want to introduce general customization hooks, similar to |
Are there any update on that ? As at the moment it's impossible do things like upsert and get the generated id. |
After investigating on this topic, we do not have proper use-cases for the related ticket #46. Therefore, we're going to introduce a slim version of filter functions for DatabaseClient databaseClient = …;
databaseClient.execute("SELECT")
.filter(s -> s.returnGeneratedValues("foo")) the bit more extended approach with a DatabaseClient databaseClient = …;
databaseClient.execute("SELECT")
.filter((s, next) -> next.execute(s.returnGeneratedValues("foo"))) |
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects. databaseClient.execute(…) .filter((s, next) -> next.execute(s.returnGeneratedValues("my_id"))) .filter((s, next) -> next.execute(s.fetchSize(25))) databaseClient.execute(…) .filter(s -> s.returnGeneratedValues("my_id")) .filter(s -> s.fetchSize(25))
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects. databaseClient.execute(…) .filter((s, next) -> next.execute(s.returnGeneratedValues("my_id"))) .filter((s, next) -> next.execute(s.fetchSize(25))) databaseClient.execute(…) .filter(s -> s.returnGeneratedValues("my_id")) .filter(s -> s.fetchSize(25))
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects. databaseClient.execute(…) .filter((s, next) -> next.execute(s.returnGeneratedValues("my_id"))) .filter((s, next) -> next.execute(s.fetchSize(25))) databaseClient.execute(…) .filter(s -> s.returnGeneratedValues("my_id")) .filter(s -> s.fetchSize(25))
Made assertions in tests more strict.
Refactored DefaultDatabaseClientUnitTests in order to make the relevant differences in setup easier to spot.
Fix nullability annotations. Relax generics at DatabaseClient.StatementFilterSpec.filter(…).
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects. databaseClient.execute(…) .filter((s, next) -> next.execute(s.returnGeneratedValues("my_id"))) .filter((s, next) -> next.execute(s.fetchSize(25))) databaseClient.execute(…) .filter(s -> s.returnGeneratedValues("my_id")) .filter(s -> s.fetchSize(25))
Made assertions in tests more strict.
Refactored DefaultDatabaseClientUnitTests in order to make the relevant differences in setup easier to spot.
Fix nullability annotations. Relax generics at DatabaseClient.StatementFilterSpec.filter(…).
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects. databaseClient.execute(…) .filter((s, next) -> next.execute(s.returnGeneratedValues("my_id"))) .filter((s, next) -> next.execute(s.fetchSize(25))) databaseClient.execute(…) .filter(s -> s.returnGeneratedValues("my_id")) .filter(s -> s.fetchSize(25)) Original pull request: #308.
Made assertions in tests more strict. Original pull request: #308.
Refactored DefaultDatabaseClientUnitTests in order to make the relevant differences in setup easier to spot. Original pull request: #308.
Fix nullability annotations. Relax generics at DatabaseClient.StatementFilterSpec.filter(…). Original pull request: #308.
Done. |
Now it is not possible to create a one-to-one relationship with the execute statement, as if you do like this (see below), the flatMap won't be invoked.
Possible solutions (@mp911de):
The text was updated successfully, but these errors were encountered: