barn-sql-client-deployment

Quarkus barn is reactive database migration tool

License

License

Categories

Categories

Quarkus Container Microservices CLI User Interface
GroupId

GroupId

org.lorislab.quarkus
ArtifactId

ArtifactId

barn-sql-client-deployment
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

barn-sql-client-deployment
Quarkus barn is reactive database migration tool
Project Organization

Project Organization

lorislab

Download barn-sql-client-deployment

How to add to project

<!-- https://jarcasting.com/artifacts/org.lorislab.quarkus/barn-sql-client-deployment/ -->
<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn-sql-client-deployment</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.lorislab.quarkus/barn-sql-client-deployment/
implementation 'org.lorislab.quarkus:barn-sql-client-deployment:0.4.0'
// https://jarcasting.com/artifacts/org.lorislab.quarkus/barn-sql-client-deployment/
implementation ("org.lorislab.quarkus:barn-sql-client-deployment:0.4.0")
'org.lorislab.quarkus:barn-sql-client-deployment:jar:0.4.0'
<dependency org="org.lorislab.quarkus" name="barn-sql-client-deployment" rev="0.4.0">
  <artifact name="barn-sql-client-deployment" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.lorislab.quarkus', module='barn-sql-client-deployment', version='0.4.0')
)
libraryDependencies += "org.lorislab.quarkus" % "barn-sql-client-deployment" % "0.4.0"
[org.lorislab.quarkus/barn-sql-client-deployment "0.4.0"]

Dependencies

compile (3)

Group / Artifact Type Version
io.quarkus : quarkus-arc-deployment jar
org.lorislab.quarkus : barn jar 0.4.0
org.lorislab.quarkus : barn-sql-client jar 0.4.0

Project Modules

There are no modules declared in this project.

Barn Quarkus extension

License GitHub Workflow Status (branch) GitHub release (latest SemVer) Maven Central

Barn Quarkus extension is database migration tool for the reactive database client. The naming convention for migration scripts is as in Flyway documentation. Supported are Versioned and Repeatable migration scripts.

Versioned Migrations

Example: V2__Add_new_table.sql

  • Prefix: V
  • Version: Version with dots separate as many parts as you like.
  • Separator: __ (two underscores)
  • Description: Underscores or spaces separate the words
  • Suffix: .sql

Repeatable Migrations

Repeatable migration will be executed only if checksum of the script change and there is new Versioned migration to run.

Example: R__Add_new_table.sql

  • Prefix: R
  • Separator: __ (two underscores)
  • Description: Underscores or spaces separate the words
  • Suffix: .sql

How to use it

Add maven dependency for your database pool:

  • org.lorislab.quarkus:barn-pg-client
  • org.lorislab.quarkus:barn-mysql-client

Create your database migration SQL scripts in the src/main/resources/db/migration directory.

+ src
   + main
      + resources
         + db
            + migration
               - V1.0_Create_tables.sql
               - V1.1_Add_search_index.sql
               - R__Update_descruption.sql

Add these properties to the applications.properties

# Clean schema before migration. Default: false
quarkus.barn.clean-at-start=true
# Start migration at start. Default: false
quarkus.barn.migrate-at-start=true
# Import test data after migration. Default: false 
quarkus.barn.test-data=true
# Test data scripts. Default: empty array
quarkus.barn.test-data-scripts=db/import/test1.sql,db/import/test2.sql

Postgres SQL reactive client

Maven dependency

<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn-pg-client</artifactId>
    <version>{latest-release-version}</version>
</dependency>

Mysql reactive client

Maven dependency

<dependency>
    <groupId>org.lorislab.quarkus</groupId>
    <artifactId>barn-mysql-client</artifactId>
    <version>{latest-release-version}</version>
</dependency>
org.lorislab.quarkus

lorislab

Versions

Version
0.4.0
0.3.0
0.2.0
0.1.0