Clients - h2 : Client

Represents an H2 client endpoint.

call

(string sqlQuery, typedesc[]? recordType, Param[] parameters)

returns table[] | () | JdbcClientError

The call remote function implementation for H2 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

select

(string sqlQuery, typedesc? recordType, Param[] parameters)

returns table | JdbcClientError

The select remote function implementation for H2 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 else sql:JdbcClientError will be returned if there is any error

update

(string sqlQuery, string[]? keyColumns, Param[] parameters)

returns UpdateResult | JdbcClientError

The update remote function implementation for H2 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)
  • sql:UpdateResult with the updated row count and key column values, else sql:JdbcClientError will be returned if there is any error

batchUpdate

(string sqlQuery, Param[] parameters)

returns int[] | JdbcClientError

The batchUpdate remote function implementation for H2 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 an sql: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

stop

()

returns error?

Stops the JDBC client.

  • Return Type

    (error?)
  • Possible error during closing