Search code examples
spring-data-r2dbc

Spring Data R2DBC Integration with Redshift Database


I'm trying to migrate to spring Data R2DBC, I couldn't find a support to Amazon Redshift database, can some one help me that if there is a support.

Here is the spring documentation url says that it supports few databases, but Redshift is not in the list. https://spring.io/projects/spring-data-r2dbc


Solution

  • I got an answer from 'Mark Paluch' below; this worked for me. So now I'm able to connect to Redshift using Postgres drivers.

    Amazon Redshift is based on Postgres, so you should use the Postgres driver. This mailing list handles R2DBC specification aspects only. If you're looking for support for a specific library built on top of R2DBC, please reach out to the actual maintainers through their, e.g., GitHub project.

    Pom.xml

    <dependency>
        <groupId>io.r2dbc</groupId>
        <artifactId>r2dbc-spi</artifactId>
        <version>0.9.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>io.r2dbc</groupId>
        <artifactId>r2dbc-postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
    
    
    application.properties:
    
    spring.r2dbc.url=r2dbc:postgresql://hostName:portNumber/databaseName
    spring.r2dbc.username=redshiftUserName
    spring.r2dbc.password=password