Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API documentation with query usages #177

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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 @@ -64,7 +64,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 @@ -76,7 +76,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 {
return nativeExecute(self, sqlQuery);
Expand All @@ -96,7 +96,7 @@ public isolated client class Client {

# Executes an 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, typedesc<record {}>[] rowTypes = [])
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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