barn-tests

Quarkus barn is reactive database migration tool

License

License

Categories

Categories

Quarkus Container Microservices
GroupId

GroupId

org.lorislab.quarkus
ArtifactId

ArtifactId

barn-tests
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

pom
Description

Description

barn-tests
Quarkus barn is reactive database migration tool
Project Organization

Project Organization

lorislab

Download barn-tests

Filename Size
barn-tests-0.4.0.pom 1 KB
Browse

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • pg-test
  • mysql-test

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