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

Closed
mlegenovic opened this issue Oct 27, 2023 · 1 comment
Assignees
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
mipo256 added a commit to mipo256/spring-data-relational that referenced this issue Sep 26, 2024
mipo256 added a commit to mipo256/spring-data-relational that referenced this issue Sep 30, 2024
@mp911de mp911de closed this as completed in 96a4121 Oct 1, 2024
mp911de added a commit that referenced this issue Oct 1, 2024
Use FilterFunction instead of nullable fetchSize to avoid unconditional capturing lambdas and improve defaulting.

Add since tag.

See #1652
Original pull request: #1898
@mp911de mp911de added this to the 3.4 RC1 (2024.1.0) milestone Oct 1, 2024
@mp911de mp911de self-assigned this Oct 2, 2024
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