Quarkus - Liquibase - Runtime

Handle your database schema migrations

License

License

Categories

Categories

Quarkus Container Microservices Liquibase Data Databases
GroupId

GroupId

com.konnectkode
ArtifactId

ArtifactId

quarkus-liquibase
Last Version

Last Version

1.0.0.CR2
Release Date

Release Date

Type

Type

jar
Description

Description

Quarkus - Liquibase - Runtime
Handle your database schema migrations

Download quarkus-liquibase

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
io.quarkus : quarkus-core jar
io.quarkus : quarkus-agroal jar
io.quarkus : quarkus-narayana-jta jar
org.liquibase : liquibase-core jar 3.8.1

Project Modules

There are no modules declared in this project.

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