-
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 #712 from kalaiyarasiganeshalingam/main
Fix spread-field error in connection pool config
- Loading branch information
Showing
7 changed files
with
301 additions
and
64 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
4 changes: 4 additions & 0 deletions
4
compiler-plugin-tests/src/test/resources/diagnostics/sample7/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,4 @@ | ||
[package] | ||
org = "oracledb_test" | ||
name = "sample7" | ||
version = "0.1.0" |
59 changes: 59 additions & 0 deletions
59
compiler-plugin-tests/src/test/resources/diagnostics/sample7/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,59 @@ | ||
// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). All Rights Reserved. | ||
// | ||
// This software is the property of WSO2 LLC. and its suppliers, if any. | ||
// Dissemination of any information or reproduction of any material contained | ||
// herein in any form is strictly forbidden, unless permitted by WSO2 expressly. | ||
// You may not alter or remove any copyright or other notice from copies of this content. | ||
|
||
import ballerinax/oracledb; | ||
import ballerinax/oracledb.driver as _; | ||
|
||
# sql:ConnectionPool parameter record with default optimized values | ||
# | ||
# + maxOpenConnections - The maximum open connections | ||
# + maxConnectionLifeTime - The maximum lifetime of a connection | ||
# + minIdleConnections - The minimum idle time of a connection | ||
type SqlConnectionPoolConfig record {| | ||
int maxOpenConnections = -10; | ||
decimal maxConnectionLifeTime = -180; | ||
int minIdleConnections = -5; | ||
|}; | ||
|
||
# mysql:Options parameter record with default optimized values | ||
# | ||
# + connectTimeout - Timeout to be used when establishing a connection | ||
type MysqlOptionsConfig record {| | ||
decimal connectTimeout = 10; | ||
|}; | ||
|
||
# [Configurable] Allocation MySQL Database | ||
# | ||
# + hostname - database hostname | ||
# + username - database username | ||
# + password - database password | ||
# + database - database name | ||
# + port - database port | ||
# + connectionPool - sql:ConnectionPool configurations, type: SqlConnectionPoolConfig | ||
# + mysqlOptions - mysql:Options configurations, type: MysqlOptionsConfig | ||
type AllocationDatabase record {| | ||
string hostname; | ||
string username; | ||
string password; | ||
string database; | ||
int port = 3306; | ||
SqlConnectionPoolConfig connectionPool; | ||
MysqlOptionsConfig mysqlOptions; | ||
|}; | ||
|
||
configurable AllocationDatabase allocationDatabase = ?; | ||
|
||
final oracledb:Client allocationDbClient = check new ( | ||
host = allocationDatabase.hostname, | ||
user = allocationDatabase.username, | ||
password = allocationDatabase.password, | ||
port = allocationDatabase.port, | ||
database = allocationDatabase.database, | ||
connectionPool = { | ||
...allocationDatabase.connectionPool | ||
} | ||
); |
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
Oops, something went wrong.