Module mysql.unsafe.commands

Use a DB via plain SQL statements (unsafe version).

Commands that are expected to return a result set - queries - have distinctive methods that are enforced. That is it will be an error to call such a method with an SQL command that does not produce a result set. So for commands like SELECT, use the query functions. For other commands, like INSERT/UPDATE/CREATE/etc, use exec.

This is the @system version of mysql's command module, and as such uses the @system rows and result ranges, and the Variant type. For the MySQLVal safe version, please import mysql.safe.commands.

Functions

NameDescription
exec(conn, sql, args) Execute an SQL command or prepared statement, such as INSERT/UPDATE/CREATE/etc.
query(conn, sql, csa) Execute an SQL SELECT command or prepared statement.
queryRow(conn, sql, csa) Execute an SQL SELECT command or prepared statement where you only want the first mysql.result.UnsafeRow, if any.
queryRowTuple(conn, sql, args) Execute an SQL SELECT command or prepared statement where you only want the first mysql.result.UnsafeRow, and place result values into a set of D variables.
queryValue(conn, sql, csa) Execute an SQL SELECT command or prepared statement and return a single value: the first column of the first row received.