-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #369 from hasathcharu/introspection-mssql
Add introspection support for PostgreSQL and MSSQL data stores
- Loading branch information
Showing
399 changed files
with
10,601 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
461 changes: 401 additions & 60 deletions
461
persist-cli-tests/src/test/java/io/ballerina/persist/tools/ToolingDbPullTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_105/Ballerina.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
distribution = "2201.8.4" | ||
name = "tool_test_generate_105" | ||
org = "wso2" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true | ||
|
21 changes: 21 additions & 0 deletions
21
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_105/main.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
// | ||
// WSO2 LLC. 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/io; | ||
|
||
public function main() { | ||
io:println("Hello, World!"); | ||
} |
49 changes: 49 additions & 0 deletions
49
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_105/persist/model.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
// | ||
// WSO2 LLC. 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/persist as _; | ||
import ballerinax/persist.sql; | ||
|
||
public enum UserGender { | ||
MALE, | ||
FEMALE | ||
} | ||
|
||
public type User record {| | ||
readonly int id; | ||
string name; | ||
UserGender gender; | ||
string nic; | ||
decimal? salary; | ||
Car[] cars; | ||
Car? drives; | ||
//Unsupported[set('a','b','c')] setType; | ||
|}; | ||
|
||
public type Car record {| | ||
readonly int id; | ||
string name; | ||
string model; | ||
@sql:Index {name: ["ownerId"]} | ||
int ownerId; | ||
@sql:Relation {keys: ["ownerId"]} | ||
User owner; | ||
@sql:Name {value: "DRIVER_ID"} | ||
int driverId; | ||
@sql:Relation {keys: ["driverId"]} | ||
User driver; | ||
//Unsupported[set('a','b','c')] setType; | ||
|}; |
10 changes: 10 additions & 0 deletions
10
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_106/Ballerina.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
distribution = "2201.8.4" | ||
name = "tool_test_generate_106" | ||
org = "wso2" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true | ||
|
||
|
21 changes: 21 additions & 0 deletions
21
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_106/main.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
// | ||
// WSO2 LLC. 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/io; | ||
|
||
public function main() { | ||
io:println("Hello, World!"); | ||
} |
57 changes: 57 additions & 0 deletions
57
persist-cli-tests/src/test/resources/test-src/input/tool_test_generate_106/persist/model.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
// | ||
// WSO2 LLC. 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/persist as _; | ||
import ballerinax/persist.sql; | ||
|
||
|
||
public type User record {| | ||
readonly int id; | ||
string name; | ||
string nic; | ||
decimal? salary; | ||
Car? drives; | ||
|}; | ||
|
||
public type Car record {| | ||
readonly int id; | ||
string name; | ||
string model; | ||
@sql:UniqueIndex | ||
int driverId; | ||
@sql:Relation {keys: ["driverId"]} | ||
User driver; | ||
|}; | ||
|
||
public type User2 record {| | ||
readonly int id; | ||
readonly string nic; | ||
string name; | ||
decimal? salary; | ||
Car2? drives; | ||
|}; | ||
|
||
public type Car2 record {| | ||
readonly int id; | ||
string name; | ||
string model; | ||
@sql:UniqueIndex {name: "driver_idx"} | ||
int driverId; | ||
@sql:UniqueIndex {name: "driver_idx"} | ||
string driverNic; | ||
@sql:Relation {keys: ["driverId", "driverNic"]} | ||
User2 driver; | ||
|}; |
13 changes: 13 additions & 0 deletions
13
...t-cli-tests/src/test/resources/test-src/input/tool_test_pull_28_postgresql/Ballerina.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
distribution = "2201.8.4" | ||
name = "tool_test_pull_28_postgresql" | ||
org = "wso2" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true | ||
|
||
[[platform.java17.dependency]] | ||
artifactId = "persist.sql-native" | ||
groupId = "io.ballerina.stdlib" | ||
version = "1.2.0" |
21 changes: 21 additions & 0 deletions
21
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_28_postgresql/main.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
// | ||
// WSO2 LLC. 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/io; | ||
|
||
public function main() { | ||
io:println("Hello, World!"); | ||
} |
24 changes: 24 additions & 0 deletions
24
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_28_postgresql/script.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). | ||
-- | ||
-- WSO2 LLC. 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. | ||
|
||
CREATE TABLE "User" ( | ||
"id" INT NOT NULL, | ||
"name" VARCHAR(191) NOT NULL, | ||
"gender" VARCHAR(6) CHECK ("gender" IN ('MALE', 'FEMALE')) NOT NULL, | ||
"nic" VARCHAR(191) NOT NULL, | ||
"salary" DECIMAL(65, 30) NOT NULL, | ||
PRIMARY KEY("id") | ||
); |
13 changes: 13 additions & 0 deletions
13
...t-cli-tests/src/test/resources/test-src/input/tool_test_pull_29_postgresql/Ballerina.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
distribution = "2201.8.4" | ||
name = "tool_test_pull_29_postgresql" | ||
org = "wso2" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true | ||
|
||
[[platform.java17.dependency]] | ||
artifactId = "persist.sql-native" | ||
groupId = "io.ballerina.stdlib" | ||
version = "1.2.0" |
Oops, something went wrong.