diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 6aa1f059..d31ae2fc 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "sql" -version = "1.11.1" +version = "1.11.2" authors = ["Ballerina"] keywords = ["database", "client", "network", "SQL", "RDBMS"] repository = "https://github.com/ballerina-platform/module-ballerina-sql" @@ -15,11 +15,11 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "sql-native" -version = "1.11.1" -path = "../native/build/libs/sql-native-1.11.1.jar" +version = "1.11.2" +path = "../native/build/libs/sql-native-1.11.2-SNAPSHOT.jar" [[platform.java17.dependency]] -path = "../test-utils/build/libs/sql-test-utils-1.11.1.jar" +path = "../test-utils/build/libs/sql-test-utils-1.11.2-SNAPSHOT.jar" scope = "testOnly" [[platform.java17.dependency]] diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index d27b59f7..c8b0a2cc 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "sql-compiler-plugin" class = "io.ballerina.stdlib.sql.compiler.SQLCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.11.1.jar" +path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.11.2-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 136d61c7..2c1c4283 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -35,7 +35,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.4.0" +version = "1.5.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.0" +version = "2.10.5" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -111,6 +111,7 @@ modules = [ org = "ballerina" name = "jballerina.java" version = "0.0.0" +scope = "testOnly" modules = [ {org = "ballerina", packageName = "jballerina.java", moduleName = "jballerina.java"} ] @@ -300,7 +301,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.11.1" +version = "1.11.2" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, diff --git a/ballerina/tests/execute-params-query-test.bal b/ballerina/tests/execute-params-query-test.bal index 615fba89..2e7687d9 100644 --- a/ballerina/tests/execute-params-query-test.bal +++ b/ballerina/tests/execute-params-query-test.bal @@ -614,25 +614,25 @@ function insertIntoArrayTable3() returns error? { groups: ["execute", "execute-params"] } function insertIntoArrayTable4() returns error? { - SmallIntArrayValue paraSmallint = new ([]); - IntegerArrayValue paraInt = new ([]); - BigIntArrayValue paraLong = new ([]); - FloatArrayValue paraFloat = new ([]); - RealArrayValue paraReal = new ([]); - DecimalArrayValue paraDecimal = new ([]); - NumericArrayValue paraNumeric = new ([]); - DoubleArrayValue paraDouble = new ([]); - CharArrayValue paraChar = new ([]); - VarcharArrayValue paraVarchar = new ([]); - NVarcharArrayValue paraNVarchar = new ([]); + SmallIntArrayValue paraSmallint = new (); + IntegerArrayValue paraInt = new (); + BigIntArrayValue paraLong = new (); + FloatArrayValue paraFloat = new (); + RealArrayValue paraReal = new (); + DecimalArrayValue paraDecimal = new (); + NumericArrayValue paraNumeric = new (); + DoubleArrayValue paraDouble = new (); + CharArrayValue paraChar = new (); + VarcharArrayValue paraVarchar = new (); + NVarcharArrayValue paraNVarchar = new (); string?[] paraString = []; - BooleanArrayValue paraBool = new ([]); - DateArrayValue paraDate = new ([]); - TimeArrayValue paraTime = new ([]); - DateTimeArrayValue paraDatetime = new ([]); - TimestampArrayValue paraTimestamp = new ([]); - BinaryArrayValue paraBinary = new ([]); - VarBinaryArrayValue paraVarBinary = new ([]); + BooleanArrayValue paraBool = new (); + DateArrayValue paraDate = new (); + TimeArrayValue paraTime = new (); + DateTimeArrayValue paraDatetime = new (); + TimestampArrayValue paraTimestamp = new (); + BinaryArrayValue paraBinary = new (); + VarBinaryArrayValue paraVarBinary = new (); byte[]?[] paraBlob = []; int rowId = 8; diff --git a/codecov.yml b/codecov.yml index c8aa0ed3..477da0bf 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,5 +1,6 @@ ignore: - "test-utils/" + - "compiler-plugin/" coverage: precision: 2 diff --git a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/sql/compiler/CompilerPluginTest.java b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/sql/compiler/CompilerPluginTest.java index fd052f3d..134e4d8f 100644 --- a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/sql/compiler/CompilerPluginTest.java +++ b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/sql/compiler/CompilerPluginTest.java @@ -58,6 +58,19 @@ private Package loadPackage(String path) { } @Test + public void testCompilerErrors() { + Package currentPackage = loadPackage("sample3"); + PackageCompilation compilation = currentPackage.getCompilation(); + DiagnosticResult diagnosticResult = compilation.diagnosticResult(); + List diagnosticErrorStream = diagnosticResult.diagnostics().stream() + .filter(r -> r.diagnosticInfo().severity().equals(DiagnosticSeverity.ERROR)) + .collect(Collectors.toList()); + long availableErrors = diagnosticErrorStream.size(); + + Assert.assertEquals(availableErrors, 1); + } + + @Test(enabled = false) public void testInvalidConnectionParamConfig() { Package currentPackage = loadPackage("sample1"); PackageCompilation compilation = currentPackage.getCompilation(); diff --git a/compiler-plugin-tests/src/test/resources/diagnostics/sample3/Ballerina.toml b/compiler-plugin-tests/src/test/resources/diagnostics/sample3/Ballerina.toml new file mode 100644 index 00000000..9b317bf4 --- /dev/null +++ b/compiler-plugin-tests/src/test/resources/diagnostics/sample3/Ballerina.toml @@ -0,0 +1,4 @@ +[package] +org = "sql_test" +name = "sample1" +version = "0.1.0" diff --git a/compiler-plugin-tests/src/test/resources/diagnostics/sample3/main.bal b/compiler-plugin-tests/src/test/resources/diagnostics/sample3/main.bal new file mode 100644 index 00000000..ee6b92ee --- /dev/null +++ b/compiler-plugin-tests/src/test/resources/diagnostics/sample3/main.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/sql; + +type ConnectionPool record { + int connection?; +} + +int|sql:ConnectionPool pool2 = { + maxOpenConnections: 10, + maxConnectionLifeTime: 10, + minIdleConnections: 2 +}; + +public function main() { + +}