Quarkus - Liquibase

Liquibase extension for Quarkus

License

License

Categories

Categories

Quarkus Container Microservices Liquibase Data Databases
GroupId

GroupId

com.konnectkode
ArtifactId

ArtifactId

quarkus-liquibase-parent
Last Version

Last Version

1.0.0.CR2
Release Date

Release Date

Type

Type

pom
Description

Description

Quarkus - Liquibase
Liquibase extension for Quarkus
Project URL

Project URL

https://github.com/konnectkode/quarkus-liquibase
Source Code Management

Source Code Management

https://github.com/konnectkode/quarkus-liquibase.git

Download quarkus-liquibase-parent

How to add to project

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

Dependencies

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

Project Modules

  • runtime
  • deployment
  • test-report

Quarkus-Liquibase - A extension Liquibase extension for quarkus framework

CircleCI Codecov Maven Central GitHub

Using Quarkus Liquibase

OBS: THIS LIBRARY DOES NOT SUPPORT NATIVE IMAGE

Setting up support for Liquibase

To start using Liquibase with your project, you just need to:

  • add your migrations to the src/main/resources/db/migration
  • activate the migrate-at-start option to migrate the schema automatically or inject the Liquibase object and run your migration

In your pom.xml, add the following dependencies:

  • the Liquibase extension
  • your JDBC driver extension
<dependencies>
    <!-- Liquibase specific dependencies -->
    <dependency>
        <groupId>com.konnectkode</groupId>
        <artifactId>quarkus-liquibase</artifactId>
    </dependency>

    <!-- JDBC driver dependencies -->
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>
</dependencies>

Liquibase support relies on the Quarkus default datasource config, you must add the default datasource properties to the application.properties file in order to allow Liquibase to manage the schema. Also, you can customize the Liquibase behaviour by using the following properties:

quarkus.liquibase.migrate-at-start

true to execute Liquibase automatically when the application starts, false otherwise. default: false

quarkus.liquibase.changelog

Changelog file path that contains the liquibase migrations
default: classpath:db/migration

quarkus.liquibase.default-schema

The name of the default schema. By default the liquibase tables are placed in the default schema for the connection provided by the datasource. When the quarkus.liquibase.default-schema property is set, the tables are placed in the provided schema.
default: <none>

quarkus.liquibase.contexts

Liquibase supports contexts a comma-separated list of contexts that works like profiles (Liquibase Contexts).
Default: <none>

The following is an example for the application.properties file:

quarkus.datasource.url=jdbc:postgresql://localhost:5432/database
quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.username=liquibase
quarkus.datasource.password=liquibase

# Liquibase minimal config properties
#quarkus.liquibase.changelog=db/changelog.xml
#quarkus.liquibase.default-schema=production
#quarkus.liquibase.contexts=production,migration

Versions

Version
1.0.0.CR2