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

Add Template method to R2dbcEntityTemplate to post-process GenericExecuteSpec for e.g. a filter function #1652

Open
mlegenovic opened this issue Oct 27, 2023 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@mlegenovic
Copy link

Is there a way to set the fetch size for R2DBC repositories or R2dbcEntityTemplate?

With JDBC you can do it on JdbcTemplate, but the R2DBC spec only provides this on the statement level, and you can't get there.

From the R2dbcEntityTemplate you can get to the DatabaseClient, but not to the statement.

Is there a way to do this somehow?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 27, 2023
@mp911de
Copy link
Member

mp911de commented Oct 27, 2023

Right now, your only option would be through DatabaseClient.builder().executeFunction(…) with an execute function like executeFunction(statement -> statement.fetchSize(100).execute()).

It makes sense to introduce a template function that accepts SQL for the database client and returns a GenericExecuteSpec. This hook would allow for specifying a filter function (to post-process the Statement before running it).

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 27, 2023
@mp911de mp911de changed the title How to set fetch-size in Spring Data R2DBC? Add Template method to R2dbcEntityTemplate to post-process GenericExecuteSpec for e.g. a filter function Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants