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

R2DBC support #2468

Closed
mirromutth opened this issue Aug 2, 2019 · 19 comments · Fixed by OpenFeign/querydsl#292
Closed

R2DBC support #2468

mirromutth opened this issue Aug 2, 2019 · 19 comments · Fixed by OpenFeign/querydsl#292

Comments

@mirromutth
Copy link

mirromutth commented Aug 2, 2019

R2DBC (Reactive Relational Database Connectivity) is for reactive programming and containing concise SPI. Looks like it will be very well integrated with the DSL-style frameworks.

See:


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@fzoli
Copy link

fzoli commented Apr 13, 2020

I wrote a reference implementation.

@riba2101
Copy link

riba2101 commented Jun 4, 2020

So..its been almost a year, can we at least get an answer? will/wont do/prs accepted etc

@jwgmeligmeyling
Copy link
Member

jwgmeligmeyling commented Jun 4, 2020

PR's will be accepted :) But no, this is not a priority of the core team.

@riba2101
Copy link

riba2101 commented Jun 4, 2020

wow that was fast, tnx man :)
Ok, will try to find time in the next month

@riba2101
Copy link

riba2101 commented Jun 4, 2020

@jwgmeligmeyling - for R2DBC we would need to bump the min version of java to 1.8, would that be ok?

@idosal
Copy link
Member

idosal commented Jun 4, 2020

@riba2101 Yes, it's on the roadmap for 5.0.

@jwgmeligmeyling
Copy link
Member

Yes, and if you implement it in a dedicated module (querydsl-r2dbc) only that module has to be JDK8 afaik. So that also helps while the other modules are still on Java 7. But with 5.x we'll go to Java 8 anyway.

@riba2101
Copy link

riba2101 commented Jun 8, 2020

oh sry, was kinda busy - yeah that's how I've started and exactly how it's currently implemented, and yes, you are correct, a single module can have a different compile version

@riba2101
Copy link

riba2101 commented Jun 8, 2020

Hey guys, so...the changes are kinda huge...dunno how you guys wanna do this? (atm it's only compiling, need to test is extensively)

I would also like to point out that its heavily based on @fzoli s example

@lpandzic
Copy link
Contributor

If you want to use R2DBC with Querydsl now and are using Spring Data, Infobip Spring Data Querydsl now has R2DBC support.
Example usage:

interface TRepository extends ReactiveSortingRepository<T, ID>, ReactiveQuerydslPredicateExecutor<T>, QuerydslR2dbcFragment<T> {
}

QuerydslJdbcFragment provides access to SQLQuery, SQLUpdateClause and delete with Predicate support.

@j30ng
Copy link

j30ng commented Mar 9, 2021

Hi all, when will #2610 be merged? Anything remains to be done?

@riba2101
Copy link

riba2101 commented Mar 9, 2021

Hi guys,

sorry I was really busy lately, will try to address the last comment shortly

@lpandzic
Copy link
Contributor

5.0.0.M1 with Java 8 as baseline has been released so that addresses the #2468 (comment).

@Camsteack
Copy link

Hi ! Are there any update on R2DBC support ?
Cheers !

@riba2101
Copy link

riba2101 commented Jun 4, 2022

guys, im super busy atm, pls try to support/further as i am currently not able to

@charlesvhe
Copy link

I am doing a demo of springboot3, which includes using QueryDSL as the Interface to generate SQL, and the underlying execution is taken over by R2DBC. Reference code: https://github.com/charlesvhe/native-image/blob/main/core/src/main/java/com/github/charlesvhe/nativeimage/QueryDslR2dbcTemplate.java

sample code:https://github.com/charlesvhe/native-image/blob/main/provider/src/main/java/com/github/charlesvhe/nativeimage/provider/ConfigMetaService.java

QBE

 @GetMapping
    public Mono<PagingResponse<ConfigMeta, ConfigMeta>> get(Paging paging) {
        return queryDslR2DbcTemplate.select(q -> q
                        .select(Projections.bean(ConfigMeta.class, QueryDslR2dbcTemplate.buildColumn(paging.getFields(), qConfigMeta.getColumns())))
                        .from(qConfigMeta)
                        .where(QueryDslR2dbcTemplate.buildWhere(paging.getFilter(), qConfigMeta.getColumns(), ExampleMatcher.StringMatcher.CONTAINING))
                        .orderBy(QueryDslR2dbcTemplate.buildOrder(paging.getSort(), qConfigMeta.getColumns()))
                        .offset(paging.getOffset())
                        .limit(paging.getLimit())
                )
                .collectList()
                .map(data -> new PagingResponse(data, paging.next()));
    }

Copy link

stale bot commented Jan 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@SledgeHammer01
Copy link

If you want to use R2DBC with Querydsl now and are using Spring Data, Infobip Spring Data Querydsl now has R2DBC support. Example usage:

interface TRepository extends ReactiveSortingRepository<T, ID>, ReactiveQuerydslPredicateExecutor<T>, QuerydslR2dbcFragment<T> {
}

QuerydslJdbcFragment provides access to SQLQuery, SQLUpdateClause and delete with Predicate support.

Does it handle relationships?

@lpandzic
Copy link
Contributor

lpandzic commented Apr 2, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants