Skip to main content

MySQL

Library of functions for accessing MySQL.

Functions

InferAndQuery

Performs a query in a MySQL database with schema detection (inference).

Syntax:
MySQL.InferAndQuery(database: string, query: string, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the MySQL table.
Example:
MySQL.InferAndQuery("database", "SELECT * FROM table")

InferAndRead

Reads a MySQL table with schema detection (inference).

Syntax:
MySQL.InferAndRead(database: string, table: string, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • table: The name of the table.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the MySQL table.
Example:
MySQL.InferAndRead("database", "table")

Query

Performs a query in a MySQL database.

Syntax:
MySQL.Query(database: string, query: string, type: type, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • type: The type of the query result.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the MySQL table.
Example:
MySQL.Query("database", "SELECT a, b FROM table", type collection(record(a: int, b: string)))

Read

Reads a MySQL table.

Syntax:
MySQL.Read(database: string, table: string, type: type, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • table: The name of the table.

  • type: The type of the table.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the MySQL table.
Example:
MySQL.Read("database", "table", type record(id: int, name: string, salary: double))