From 084f50cb200fae44b2dab01c7803fa9c6b27c53a Mon Sep 17 00:00:00 2001 From: stewartbryson Date: Thu, 11 May 2023 20:51:35 +0000 Subject: [PATCH] Updating README and examples. --- README.md | 15 +++++++-------- examples/groovy/build.gradle | 2 +- examples/java-external-stage/build.gradle | 2 +- examples/java-testing/build.gradle | 4 ++-- examples/java/build.gradle | 2 +- examples/kotlin/build.gradle | 2 +- examples/scala/build.gradle | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b058bb7..db50be1 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ is automatically applied by the `snowflake` plugin: ```groovy plugins { id 'java' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } ``` @@ -235,7 +235,7 @@ Our `plugins` DSL from the build file: plugins { id 'java' id 'groovy' // needed for Spock testing framework - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } ``` @@ -312,7 +312,7 @@ functionalTest(JvmTestSuite) { all { useSpock('2.3-groovy-3.0') dependencies { - implementation "io.github.stewartbryson:gradle-snowflake-plugin:2.0.11" + implementation "io.github.stewartbryson:gradle-snowflake-plugin:2.0.12" } testTask.configure { failFast true @@ -348,7 +348,7 @@ class SnowflakeSampleTest extends SnowflakeSpec { def b = 2 then: 'Add two numbers using ADD_NUMBERS()' - selectSingleValue("select add_numbers($a,$b);") == 'Sum is: 3' + selectFunction("add_numbers", [a,b]) == 'Sum is: 3' } def 'ADD_NUMBERS() function with 3 and 4'() { @@ -357,14 +357,13 @@ class SnowflakeSampleTest extends SnowflakeSpec { def b = 4 then: 'Add two numbers using ADD_NUMBERS()' - selectSingleValue("select add_numbers($a,$b);") == 'Sum is: 7' + selectFunction("add_numbers", [a,b]) == 'Sum is: 7' } } - ``` -The `selectSingleValue` method returns the first column from the first row in a `SELECT` statement, -so it's perfect for testing a function. And of course, this executes against Snowflake in real time. +The `selectFunction` method is an easy way to execute a function and test the results by just passing the function name and a list of arguments to pass to that function. +And of course, this executes against Snowflake in real time. ```shell ❯ ./gradlew functionalTest diff --git a/examples/groovy/build.gradle b/examples/groovy/build.gradle index 9f27d57..bb7f79e 100644 --- a/examples/groovy/build.gradle +++ b/examples/groovy/build.gradle @@ -1,7 +1,7 @@ plugins { id 'groovy' id 'com.github.ben-manes.versions' version '0.46.0' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } repositories { diff --git a/examples/java-external-stage/build.gradle b/examples/java-external-stage/build.gradle index cab8308..e13b97e 100644 --- a/examples/java-external-stage/build.gradle +++ b/examples/java-external-stage/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'com.github.ben-manes.versions' version '0.46.0' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } repositories { diff --git a/examples/java-testing/build.gradle b/examples/java-testing/build.gradle index d7fe31d..ce220a4 100644 --- a/examples/java-testing/build.gradle +++ b/examples/java-testing/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'groovy' // needed for Spock testing framework - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' id 'com.adarshr.test-logger' version '3.2.0' // added for testing id 'com.github.ben-manes.versions' version '0.46.0' } @@ -43,7 +43,7 @@ testing { all { useSpock('2.3-groovy-3.0') dependencies { - implementation "io.github.stewartbryson:gradle-snowflake-plugin:2.0.11" + implementation "io.github.stewartbryson:gradle-snowflake-plugin:2.0.12" } testTask.configure { failFast true diff --git a/examples/java/build.gradle b/examples/java/build.gradle index d1ebe9c..83b4a0f 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'com.github.ben-manes.versions' version '0.46.0' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } repositories { diff --git a/examples/kotlin/build.gradle b/examples/kotlin/build.gradle index 2d25e34..567c4db 100644 --- a/examples/kotlin/build.gradle +++ b/examples/kotlin/build.gradle @@ -1,7 +1,7 @@ plugins { id "org.jetbrains.kotlin.jvm" version "1.7.21" id 'com.github.ben-manes.versions' version '0.46.0' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } repositories { diff --git a/examples/scala/build.gradle b/examples/scala/build.gradle index 40f1bcb..048fd8a 100644 --- a/examples/scala/build.gradle +++ b/examples/scala/build.gradle @@ -1,7 +1,7 @@ plugins { id 'scala' id 'com.github.ben-manes.versions' version '0.46.0' - id 'io.github.stewartbryson.snowflake' version '2.0.11' + id 'io.github.stewartbryson.snowflake' version '2.0.12' } repositories {