Clients -
mysql :
Client
Represents an MySQL client endpoint.
Constructor
__init
Remote Methods
The call remote function implementation for MySQL Client to invoke stored procedures/functions.
The select remote function implementation for MySQL Client to select data from tables.
The update remote function implementation for MySQL Client to update data and schema of the database.
The batchUpdate remote function implementation for MySQL Client to batch data insert.
Methods
call
(string sqlQuery, typedesc[]? recordType, Param[] parameters)
returns table[] | () | JdbcClientErrorThe call remote function implementation for MySQL Client to invoke stored procedures/functions.
Parameters
- sqlQuery string
-
The SQL stored procedure to execute
- recordType typedesc[]?
-
Array of record types of the returned tables if there is any
- parameters Param[]
-
The parameters to be passed to the procedure/function call. The number of parameters is variable
-
Return Type
(table[] | () | JdbcClientError) A
table[]
if there are tables returned by the call remote function and else nil,sql:JdbcClientError
will be returned if there is any error
The select remote function implementation for MySQL Client to select data from tables.
Parameters
- sqlQuery string
-
SQL query to execute
- recordType typedesc?
-
Type of the returned table
- parameters Param[]
-
The parameters to be passed to the select query. The number of parameters is variable
-
Return Type
(table | JdbcClientError) A
table
returned by the sql query statement elsesql:JdbcClientError
will be returned if there is any error
update
(string sqlQuery, string[]? keyColumns, Param[] parameters)
returns UpdateResult | JdbcClientErrorThe update remote function implementation for MySQL Client to update data and schema of the database.
Parameters
- sqlQuery string
-
SQL statement to execute
- keyColumns string[]? - ()
-
Names of auto generated columns for which the auto generated key values are returned
- parameters Param[]
-
The parameters to be passed to the update query. The number of parameters is variable
-
Return Type
(UpdateResult | JdbcClientError) A
sql:UpdateResult
with the updated row count and key column values, elsesql:JdbcClientError
will be returned if there is any error
The batchUpdate remote function implementation for MySQL Client to batch data insert.
Parameters
- sqlQuery string
-
SQL statement to execute
- parameters Param[]
-
Variable number of parameter arrays each representing the set of parameters of belonging to each individual update
-
Return Type
(int[] | JdbcClientError) An
int[]
- The elements in the array returned by the operation may be one of the following or else ansql:JdbcClientError
will be returned if there is any error. A number greater than or equal to zero - indicates that the command was processed successfully and is an update count giving the number of rows A value of -2 - Indicates that the command was processed successfully but that the number of rows affected is unknown A value of -3 - Indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails