Skip to content

Commit

Permalink
Merge pull request #345 from niveathika/master
Browse files Browse the repository at this point in the history
Improve specification description
  • Loading branch information
daneshk authored Jan 23, 2022
2 parents ead822d + 83912f4 commit 7d817ec
Showing 1 changed file with 31 additions and 34 deletions.
65 changes: 31 additions & 34 deletions docs/spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ lifetime of the client.
#
# + host - Hostname of the MySQL server
# + user - If the MySQL server is secured, the username
# + password - The password of provided username
# + database - The name fo the database
# + port - Port number of the mysql server
# + password - The password of the MySQL server for the provided username
# + database - The name of the database
# + port - Port number of the MySQL server
# + options - MySQL database options
# + connectionPool - The `sql:ConnectionPool` to be used for the connection. If there is no
# `connectionPool` provided, the global connection pool (shared by all
Expand All @@ -62,38 +62,35 @@ public isolated function init(string host = "localhost", string? user = (),

**Configurations available for initializing the MySQL client:**
* Connection properties:
```ballerina
# Provides a set of configuration related to MySQL database.
#
# + ssl - SSL Configuration to be used
# + failoverConfig - Server Failover configurations to be used
# + useXADatasource - Enables XADatasource
# + connectTimeout - Timeout (in seconds) to be used when connecting to the mysql server
# + socketTimeout - Socket timeout (in seconds) during the read/write operations with
# the MySQL server (0 means no socket timeout)
# + serverTimezone - Configures the connection time zone, which is used by the
# `Connector/J` if the conversion between a Ballerina application and
# a target time zone is needed when preserving instant temporal values
# + noAccessToProcedureBodies - With this option the user is allowed to invoke procedures
# to whose metadata access is denied
public type Options record {|
SecureSocket ssl?;
FailoverConfig failoverConfig?;
boolean useXADatasource = false;
decimal connectTimeout = 30;
decimal socketTimeout = 0;
string serverTimezone?;
boolean noAccessToProcedureBodies = false;
|};
```
```ballerina
# Provides a set of additional configurations related to the MySQL database connection.
#
# + ssl - SSL configurations to be used
# + failoverConfig - Server failover configurations to be used
# + useXADatasource - Flag to enable or disable XADatasource
# + connectTimeout - Timeout (in seconds) to be used when establishing a connection to the MySQL server
# + socketTimeout - Socket timeout (in seconds) to be used during the read/write operations with the MySQL server
# (0 means no socket timeout)
# + serverTimezone - Configures the connection time zone, which is used by the `Connector/J` if the conversion between
# a Ballerina application and a target time zone is required when preserving instant temporal values
# + noAccessToProcedureBodies - With this option the user is allowed to invoke procedures with access to metadata restricted
public type Options record {|
SecureSocket ssl?;
FailoverConfig failoverConfig?;
boolean useXADatasource = false;
decimal connectTimeout = 30;
decimal socketTimeout = 0;
string serverTimezone?;
boolean noAccessToProcedureBodies = false;
|};
```
* Server Failover Support
```ballerina
# Configuration to be used for Server Failover.
# Configuration to be used for server failover.
#
# + failoverServers - Array of `mysql:FailoverServer` for the secondary databases
# + timeBeforeRetry - Time the driver waits before trying to fall back to the primary host
# + queriesBeforeRetry - Number of queries that are executed before the driver tries to
# fall back to the primary host
# + failoverServers - Array of `mysql:FailoverServer` for the secondary servers
# + timeBeforeRetry - Time the driver waits before attempting to fall back to the primary host
# + queriesBeforeRetry - Number of queries that are executed before the driver attempts to fall back to the primary host
# + failoverReadOnly - Open connection to secondary host with READ ONLY mode.
public type FailoverConfig record {|
FailoverServer[] failoverServers;
Expand All @@ -106,8 +103,8 @@ public isolated function init(string host = "localhost", string? user = (),
```ballerina
# Configuration for failover servers
#
# + host - Hostname of the secondary database
# + port - Port of the secondary database
# + host - Hostname of the secondary server
# + port - Port of the secondary server
public type FailoverServer record {|
string host;
int port;
Expand Down

0 comments on commit 7d817ec

Please sign in to comment.