Git Product home page Git Product logo

liquibase-athena's Introduction

Liquibase Athena Extension

This is a Liquibase extension for connecting to an Amazon Athena database.

Amazon Athena is an interactive query service that analyzes data directly in Amazon Simple Storage Service (Amazon S3) using standard SQL.


NOTE

Athena extension uses Iceberg tables to manage Liquibase Tracking Tables.


Configuring the extension

These instructions will help you get the extension up and running on your local machine for development and testing purposes. This extension has a prerequisite of Liquibase core in order to use it. Liquibase core can be found at https://www.liquibase.org/download

Pre-requisites

The following dependencies have to be available before using it:

Liquibase CLI

Download the latest released Liquibase extension .jar file and place it in the liquibase/lib install directory. If you want to use another location, specify the extension .jar and athena-jdbc-*.jar file in the classpath of your liquibase.properties file.

Maven

First, add Github repository authentication to your pom.xml or settings.xml+:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
    ...
    <servers>
      ...
        <server>
            <id>github</id>
            <username>{GITHUB_TOKEN}</username>
            <password>{GITHUB_TOKEN}</password>
        </server>
        ...
    </servers>
    ...
</settings>

Specify the Liquibase extension in the <dependency> section of pom.xml by adding the org.liquibase.ext dependency for the Liquibase plugin.

...
   <repositories>
      ...
      <repository>
         <id>github</id>
         <url>https://maven.pkg.github.com/alvsanand/liquibase-athena</url>
         <snapshots>
               <enabled>true</enabled>
         </snapshots>
      </repository>
      ...
   </repositories>
...
<plugins>
   ...
   <plugin>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-maven-plugin</artifactId>
      <version>4.3.2</version>
      <configuration>
         <propertyFile>liquibase.properties</propertyFile>
      </configuration>
      <dependencies>
         <dependency>
            <groupId>org.liquibase.ext</groupId>
            <artifactId>liquibase-athena</artifactId>
            <version>${liquibase-athena.version}</version>
         </dependency>
      </dependencies>
   </plugin>
...
</plugins>
...

Extension Properties

Liquibase Athena extension needs to be configured to work so you must add the following properties:

# The S3 path where to store Liquibase tables.
liquibase.athena.liquibaseTableS3Location=s3://some_bucket/some_path

Java call

public class Application {
    public static void main(String[] args) {
        AthenaDatabase database = (AthenaDatabase) DatabaseFactory.getInstance().openDatabase(url, null, null, null, null);
        Liquibase liquibase = new Liquibase("liquibase/ext/changelog.generic.test.xml", new ClassLoaderResourceAccessor(), database);
        liquibase.update("");
    }
}

Issue Tracking

Any issues can be logged in the Github issue tracker.

License

This project is licensed under the Apache License Version 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.