kulmam92/digdag-plugin-mssql


This creates mssql operator for digdag.

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.kulmam92:digdag-plugin-mssql:0.1.2'
	}
	dependencies {
		implementation("com.github.kulmam92:digdag-plugin-mssql:0.1.2")
	}
	<dependency>
	    <groupId>com.github.kulmam92</groupId>
	    <artifactId>digdag-plugin-mssql</artifactId>
	    <version>0.1.2</version>
	</dependency>

                            
    libraryDependencies += "com.github.kulmam92" % "digdag-plugin-mssql" % "0.1.2"
        
        

                            
    :dependencies [[com.github.kulmam92/digdag-plugin-mssql "0.1.2"]]
        
        

Readme


digdag-plugin-mssql

Digdag mssql> operator plugin to execute a query on MsSQL server. <br>Created by converting https://github.com/hiroyuki-sato/digdag-plugin-mysql to mssql version.

Warning

  • You can't use GO in the sql file. If you need to use that or run complex query, you may call SQLCMD using sh operator like below example.
  • sh>: sqlcmd -i test1.sql -f 65001 -S "${host},${port}" -e -b

configuration

Release list.

_export:
  plugin:
    repositories:
      - file://${repos}
      #- file:///path/to/digdag-plugin-mssql/build/repo
      #- https://jitpack.io
    dependencies:
      - com.github.kulmam92:digdag-plugin-mssql:0.1.3-SNAPSHOT

  mssql:
    host: localhost
    user: sa
    database: tempdb

+step1:
  mssql>: test1.sql

+step2:
  mssql>: test2.sql
  download_file: test.txt  

Run MSSQL container

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=mssql_password@1" -p 1433:1433 --name mssql1 -d mcr.microsoft.com/mssql/server:latest-ubuntu

Register mssql password into secrets.

local mode

digdag secrets --local --set mssql.password

server mode

digdag secrets --project <project> --set mssql.password

Development

1) build

./gradlew publish

Artifacts are build on local repos: ./build/repo.

2) run an example

digdag selfupdate

rm -rf .digdag/plugin 
digdag run -a --project sample plugin.dig -p repos=`pwd`/build/repo