Skip to content

Commit

Permalink
Merge pull request #155 from niveathika/main
Browse files Browse the repository at this point in the history
Improve API documentation with query usages
  • Loading branch information
kaneeldias authored Feb 17, 2022
2 parents e011b3a + 9a2a0cb commit 7118590
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public isolated client class Client {

# Executes the query, which may return multiple results.
#
# + sqlQuery - The SQL query
# + sqlQuery - The SQL query such as `` `SELECT * from Album WHERE name={albumName}` ``
# + rowType - The `typedesc` of the record to which the result needs to be returned
# + return - Stream of records in the `rowType` type
remote isolated function query(sql:ParameterizedQuery sqlQuery, typedesc<record {}> rowType = <>)
Expand All @@ -61,7 +61,7 @@ public isolated client class Client {
# Executes the query, which is expected to return at most one row of the result.
# If the query does not return any results, an `sql:NoRowsError` is returned.
#
# + sqlQuery - The SQL query
# + sqlQuery - The SQL query such as `` `SELECT * from Album WHERE name={albumName}` ``
# + returnType - The `typedesc` of the record to which the result needs to be returned.
# It can be a basic type if the query result contains only one column
# + return - Result in the `returnType` type or an `sql:Error`
Expand All @@ -73,7 +73,7 @@ public isolated client class Client {

# Executes the SQL query. Only the metadata of the execution is returned (not the results from the query).
#
# + sqlQuery - The SQL query
# + sqlQuery - The SQL query such as `` `DELETE FROM Album WHERE artist={artistName}` ``
# + return - Metadata of the query execution as an `sql:ExecutionResult` or an `sql:Error`
remote isolated function execute(sql:ParameterizedQuery sqlQuery)
returns sql:ExecutionResult|sql:Error = @java:Method {
Expand All @@ -96,7 +96,7 @@ public isolated client class Client {

# Executes a SQL query, which calls a stored procedure. This may or may not return results.
#
# + sqlQuery - The SQL query
# + sqlQuery - The SQL query such as `` `CALL sp_GetAlbums();` ``
# + rowTypes - `typedesc` array of the records to which the results need to be returned
# + return - Summary of the execution and results are returned in an `sql:ProcedureCallResult`, or an `sql:Error`
remote isolated function call(sql:ParameterizedCallQuery sqlQuery,
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Changed
- [Improve API documentation to reflect query usages](https://github.com/ballerina-platform/ballerina-standard-library/issues/2524)

## [1.3.0] - 2022-01-29

Expand Down

0 comments on commit 7118590

Please sign in to comment.