Module mysql.safe.commands

Use a DB via plain SQL statements (safe 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 @safe version of mysql's command module, and as such uses the @safe rows and result ranges, and the MySQLVal type. For the Variant unsafe version, please import mysql.unsafe.commands.

See the Safe Migration document for more details.

Functions

NameDescription
exec(conn, sql) 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 SafeRow, if any.
queryRowTuple(conn, sql, args) Execute an SQL SELECT command or prepared statement where you only want the first mysql.result.Row, 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.

Structs

NameDescription
ColumnSpecialization This feature is not yet implemented. It currently has no effect.

Aliases

NameTypeDescription
CSN ColumnSpecialization This feature is not yet implemented. It currently has no effect.