Gradle SQL Release Plugin

Plugin to release sql scripts to a target database

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.github.skhatri
ArtifactId

ArtifactId

gradle-sqlrelease-plugin
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Gradle SQL Release Plugin
Plugin to release sql scripts to a target database
Project URL

Project URL

https://github.com/skhatri/gradle-sqlrelease-plugin
Source Code Management

Source Code Management

https://github.com/skhatri/gradle-sqlrelease-plugin

Download gradle-sqlrelease-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.skhatri/gradle-sqlrelease-plugin/ -->
<dependency>
    <groupId>com.github.skhatri</groupId>
    <artifactId>gradle-sqlrelease-plugin</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.skhatri/gradle-sqlrelease-plugin/
implementation 'com.github.skhatri:gradle-sqlrelease-plugin:1.0.1'
// https://jarcasting.com/artifacts/com.github.skhatri/gradle-sqlrelease-plugin/
implementation ("com.github.skhatri:gradle-sqlrelease-plugin:1.0.1")
'com.github.skhatri:gradle-sqlrelease-plugin:jar:1.0.1'
<dependency org="com.github.skhatri" name="gradle-sqlrelease-plugin" rev="1.0.1">
  <artifact name="gradle-sqlrelease-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.skhatri', module='gradle-sqlrelease-plugin', version='1.0.1')
)
libraryDependencies += "com.github.skhatri" % "gradle-sqlrelease-plugin" % "1.0.1"
[com.github.skhatri/gradle-sqlrelease-plugin "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
commons-io : commons-io jar 2.0.1
commons-pool : commons-pool jar 1.5.4
commons-dbcp : commons-dbcp jar 1.3

Project Modules

There are no modules declared in this project.

gradle-sqlrelease-plugin

SqlPlugin - a simple plugin to release SQL scripts to targetted environment.

Usage:

buildscript {
    ext.buildDeps = [
            'com.h2database:h2:1.4.182',
            'mysql:mysql-connector-java:5.1.13',
            'com.github.skhatri:gradle-sqlrelease-plugin:1.0-SNAPSHOT'
    ]
    repositories.addAll(project.repositories)
    dependencies {
        project.ext.buildDeps.each {
            classpath it
        }
    }
}


apply plugin: 'sqlrelease'
sql {
    username = project.ext['database.username']
    password = project.ext['database.password']
    url = project.ext['database.url']
    driverClassName = project.ext['database.driverClassName']
    dialect = 'mysql'

    app = 'myapp'
    testDataDir = 'src/main/database/testdata'
    includeTestData = true

    drop.dir = 'src/main/database/init'
    drop.filePattern = '**/*.*'

    release.dir = 'src/main/database/release'
    release.fileExt = '.sql'

    run.autocommit = true
    run.delimiter = ';'
}

Available Tasks

reset       ->  drops then runs release scripts
drop        ->  drops the database objects using drop scripts
release     ->  runs the release scripts
showVersion ->  shows the latest version of script that is released
initialize  ->  point where sql connection is established

Works With

Sybase, MySQL, H2, Oracle

Simply pass dialect value of "mysql", "sybase", "h2" or "oracle". The values are case-insensitive.

Versions

Version
1.0.1
1.0