Questions tagged [spring-data-r2dbc]

Spring Data R2DBC is a module of Spring Data based on R2DBC R2DBC stands for Reactive Relational Database Connectivity.

See https://spring.io/projects/spring-data-r2dbc for more information.

412 questions
2
votes
0 answers

R2DBC Return Type @Query

I would like to be able to insert a value into a table into r2dbc using the @Query designation (as opposed to the built in save function. However I don't know what the return type is for the SQL statement. I've tried String, Book, List Unit,…
yosemeti
  • 206
  • 4
  • 15
2
votes
1 answer

ReactiveCrudRepository vs. R2dbcRepository

I am learning the reactive stack starting with R2DBC and this is what I don't understand: What are the differences between these, when to use them, and how relevant the @Repository stereotype annotation is to…
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183
2
votes
2 answers

R2DBC adjacency list get all children

I have a table which has id and parentId columns: i refer to this structure as an adjacency list. So, now i want to get all children of arbitrary id. Classic solution of this problem use recursion, for example here is Postgres procedure or CTE…
2
votes
1 answer

How to stream filepart to database (r2dbc postgres)?

The question says it. I could not find any information on streaming byte arrays to a postgresql database in spring using r2dbc, e.g. for a file upload. I can store the bytes, by reading all bytes of a file like this: @PostMapping("/upload") suspend…
Stuck
  • 11,225
  • 11
  • 59
  • 104
2
votes
0 answers

updateTime column default is not working with Spring Webflux and H2 R2DBC

Using Spring webflux with H2-R2DBC and creating a course by adding the details in course table defined as below. CREATE TABLE IF NOT EXISTS course( id VARCHAR(40) PRIMARY KEY, name VARCHAR(40) NOT NULL, fee DECIMAL, updatedtime TIMESTAMP DEFAULT…
2
votes
0 answers

Spring data r2dbc update

I have a table with non-auto generated primary key which is basically a foreign key. So, using withId method as said in the documentation. https://docs.spring.io/spring-data/r2dbc/docs/1.2.3/reference/html/#reference Creating a new instance is…
user1578872
  • 7,808
  • 29
  • 108
  • 206
2
votes
1 answer

Can't connect to CockroachCloud Free (beta) Cluster from a Spring Data R2DBC driver

I created CrockroachCloud Free (beta) Cluster and I was able to connect to the DB with the command line. But when I tried to connect from a Spring Data R2DBC driver I get an exception. I'm using following connection string in my…
2
votes
1 answer

Spring Boot R2DBC fails to store character field in MariaDB

I am buildinga REST API using Spring Reactive + MariaDB. I am trying to store a User object. It has these properties. emailAddress (String), fullName (String), password (String) Equivalent columns in database are: emailAddress (varchar), fullName…
Jibran
  • 23
  • 3
2
votes
1 answer

Spring R2DBC DatabaseClient losing TZ information

I have a db entity with some Instant type fields. org.springframework.data.r2dbc.core.DatabaseClient (which is now deprecated), had a method .as(..) to automatically map to a java entity and it honoured the timezones too. Not sure how that happened…
Shobhit Tyagi
  • 93
  • 1
  • 9
2
votes
1 answer

MultiTenancy with ReactiveCrudRepository

I have a Spring boot webflux application. Its a SAAS application and there will be multiple organization and multiple users from each organization. So, I store org_id in each table and apply where org_id=? in each select, update and delete…
2
votes
1 answer

How to save field as JSON with Spring Data R2DBC and Postgres

There are any way to save some field of entity as Json with spring-data-r2dbc? Example: @Table("A") class A { @Id var id: String = "1" var some: MutableMap = mutableMapOf() } And table: create table A ( id varchar(255) not…
Mikhail Kadysev
  • 103
  • 1
  • 10
2
votes
2 answers

Spring Webflux send event when any new data

I'm trying to learn Spring webflux & R2DBC. The one I try is simple use case: have a book table create an API (/books) that provides text stream and returning Flux I'm hoping when I hit /books once, keep my browser open, and any new data…
Timothy
  • 855
  • 1
  • 13
  • 29
2
votes
1 answer

Specify a schema using r2dbc-mssql

Is there any way to specify a default schema in a properties file using r2dbc-mssql? The connection works fine with: spring: r2dbc: url: 'r2dbc:mssql://zzzzz.database.windows.net:1433/dbname' username: 'xxxxxx' password: 'xxxxxx' but…
Pierre Recuay
  • 83
  • 1
  • 7
2
votes
2 answers

How can I validate entities with spring data r2dbc?

In Spring data JPA there are annotations that can be used to set up validations for entities in a declarative manner. They can be found in javax.validation.constraints.* or additionally in org.hibernate.validator.constraints.* (in the case when…
fyrkov
  • 2,245
  • 16
  • 41
2
votes
2 answers

Retrieve generated IDs when doing bulk insert using Spring Data R2DBC

I have a scenario where my table has an autogenerated id column and I need to bulk insert items into db and fetch the generated ids. Is there any way I can achieve that? This is my table: CREATE TABLE test_table ( `id` SERIAL NOT NULL, `name`…