name.nkonev.r2dbc-migrate:spring-boot-starter-r2dbc-migrate

R2DBC Migrate Spring Boot Starter

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

name.nkonev.r2dbc-migrate
ArtifactId

ArtifactId

spring-boot-starter-r2dbc-migrate
Last Version

Last Version

0.0.23
Release Date

Release Date

Type

Type

jar
Description

Description

R2DBC Migrate Spring Boot Starter

Download spring-boot-starter-r2dbc-migrate

How to add to project

<!-- https://jarcasting.com/artifacts/name.nkonev.r2dbc-migrate/spring-boot-starter-r2dbc-migrate/ -->
<dependency>
    <groupId>name.nkonev.r2dbc-migrate</groupId>
    <artifactId>spring-boot-starter-r2dbc-migrate</artifactId>
    <version>0.0.23</version>
</dependency>
// https://jarcasting.com/artifacts/name.nkonev.r2dbc-migrate/spring-boot-starter-r2dbc-migrate/
implementation 'name.nkonev.r2dbc-migrate:spring-boot-starter-r2dbc-migrate:0.0.23'
// https://jarcasting.com/artifacts/name.nkonev.r2dbc-migrate/spring-boot-starter-r2dbc-migrate/
implementation ("name.nkonev.r2dbc-migrate:spring-boot-starter-r2dbc-migrate:0.0.23")
'name.nkonev.r2dbc-migrate:spring-boot-starter-r2dbc-migrate:jar:0.0.23'
<dependency org="name.nkonev.r2dbc-migrate" name="spring-boot-starter-r2dbc-migrate" rev="0.0.23">
  <artifact name="spring-boot-starter-r2dbc-migrate" type="jar" />
</dependency>
@Grapes(
@Grab(group='name.nkonev.r2dbc-migrate', module='spring-boot-starter-r2dbc-migrate', version='0.0.23')
)
libraryDependencies += "name.nkonev.r2dbc-migrate" % "spring-boot-starter-r2dbc-migrate" % "0.0.23"
[name.nkonev.r2dbc-migrate/spring-boot-starter-r2dbc-migrate "0.0.23"]

Dependencies

compile (3)

Group / Artifact Type Version
name.nkonev.r2dbc-migrate : r2dbc-migrate-core jar 0.0.23
org.springframework.boot : spring-boot-starter jar
org.springframework.boot : spring-boot-starter-logging jar

Project Modules

There are no modules declared in this project.

R2DBC migration tool

Maven Central Docker Image Version (latest semver) Build Status

Inspired by this announcement.

R2DBC page.

Supported databases

  • PostgreSQL
  • Microsoft SQL Server
  • MySQL
  • H2

It also supports user-provided dialect. You can pass implementation of SqlQueries interface to the migrate() method. If you use Spring Boot, just define a bean of type SqlQueries. Example SimplePostgresqlDialect.

Features

  • Convention-based file names, for example V3__insert_to_customers__split,nontransactional.sql
  • It waits until database have been started, there is test query, and validation result of. This can be useful to initial load data into database with docker-compose
  • Supports migrations files larger than -Xmx: file will be splitted line-by-line (split modifier), then it will be loaded by chunks into database
  • Lock support, that make you able to start number of replicas your microservice, without care of migrations will collide each other
  • Each migration runs in the separated transaction
  • It also supports nontransactional migrations, due to SQL Server prohibits CREATE DATABASE in the transaction
  • Docker image
  • First-class Spring Boot integration, see example below
  • Also you can use this library without Spring (Boot) see library example below
  • This library tends to be non-invasive, consequently it intentionally doesn't try to parse SQL and make some decisions relying on. So (in theory) you can freely update database and driver's version

All available configuration options are in R2dbcMigrateProperties class. Their descriptions are available in your IDE Ctrl+Space help or in spring-configuration-metadata.json file.

Download

Docker

docker pull nkonev/r2dbc-migrate:latest

Spring Boot Starter

<dependency>
  <groupId>name.nkonev.r2dbc-migrate</groupId>
  <artifactId>r2dbc-migrate-spring-boot-starter</artifactId>
  <version>VERSION</version>
</dependency>

Only library

<dependency>
    <groupId>name.nkonev.r2dbc-migrate</groupId>
    <artifactId>r2dbc-migrate-core</artifactId>
    <version>VERSION</version>
</dependency>

If you use library, you need also use some implementation of r2dbc-migrate-resource-reader-api, for example:

<dependency>
    <groupId>name.nkonev.r2dbc-migrate</groupId>
    <artifactId>r2dbc-migrate-resource-reader-reflections</artifactId>
    <version>VERSION</version>
</dependency>

See Library example below.

Standalone application

If you want to build your own docker image you will be able to do this

curl -Ss https://repo.maven.apache.org/maven2/name/nkonev/r2dbc-migrate/r2dbc-migrate-standalone/VERSION/r2dbc-migrate-standalone-VERSION.jar > /tmp/migrate.jar

Spring Boot Example

https://github.com/nkonev/r2dbc-migrate-example

Library example

https://github.com/nkonev/r2dbc-migrate-example/tree/library

Versions

Version
0.0.23
0.0.22
0.0.20
0.0.19
0.0.14
0.0.13
0.0.12
0.0.9