# Liquibase Integration

DBmarlin can link to Liquibase so that you can relate database performance to schema changes triggered by Liquibase changesets.

tip

Requires the Pro version of Liquibase 4.20.0 or later. You can get 30-day license from <https://www.liquibase.com/trial>

## Enable the integration

Connecting Liquibase and DBmarlin takes only a few minutes to setup. ​When a Liquibase changeset runs, an event is sent to the DBmarlin API containing the change details. This will then appears on the timeline of any charts within the product. Seeing whether any change had a positive or negative affect on the database is now simple. The DBmarlin Comparison Reports can be used analyse the period before and after the change and highlight any differences.

## Installation

[Download the latest released](https://github.com/liquibase/liquibase-dbmarlin/releases) Liquibase extension `.jar` file and place it in the `liquibase/lib` directory.

Add the following properties to your `liquibase.properties` file.

```
# Liquibase Properties

liquibase.licenseKey: <get a license key and add it add it here>

liquibase.logFormat: JSON_PRETTY

logLevel: INFO



# DBmarlin Properties

dbmarlin.url: *** URL to your DBmarlin Instance ***

dbmarlin.instanceId: *** The database target ID from the DBmarlin dashboard ***

dbmarlin.apiKey: 

dbmarlin.eventTypeId:  *** The event type ID from the DBmarlin event type settings screen ***
```

## Creating a Custom Event Type for Liquibase

In DBmarlin under Settings -> Event Types you can create a new one called 'Liquibase change' and set the **Icon Code** to `fak fa-liquibase-icon` to get a Liquibase icon.

## How it works

1. Once setup, each time a changeset is applied, Liquibase sends the schema change details to DBmarlin by making an API call to DBmarlin with changeset details.

2. DBmarlin shows the Liquibase events in the [Event History screen](https://docs.dbmarlin.com/docs/using-dbmarlin/event-history/.md)

![Liquibase chart annotation in DBmarlin](/assets/images/dbmarlin-liquibase-event-history-5fe998578aba7c9cb12355b8f9824bb8.jpg)

3. It also shows on the Events tab for the instance

![DBmarlin Event History for Liquibase](/assets/images/dbmarlin-liquibase-event-tab-05652349b02e30be2de09f3d56aeb112.jpg)

4. You can see whether the Liquibase triggered change had a positive or negative impact on the database performance look at the annotations on the charts,

![Liquibase chart annotation in DBmarlin](/assets/images/liquibase-dbmarlin-chart-annotation-56c2dc87c6b75042229113f25ea46b56.jpg)

## Video walkthough

This 10 minute video is a detailed step by step walkthrough of how to configure the integration.
