queryRow

Execute an SQL SELECT command or prepared statement where you only want the first mysql.result.Row, if any.

If the SQL command does not produce a result set (such as INSERT/CREATE/etc), then mysql.exceptions.MYXNoResultRecieved will be thrown. Use exec instead for such commands.

Only use the string sql overload when you are not going to be using the same command repeatedly and you are CERTAIN all the data you're sending is properly escaped. Otherwise, consider using overload that takes a Prepared.

If there are long data items among the expected result columns you can use the csa param to specify that they are to be subject to chunked transfer via a delegate.

More...
  1. Nullable!Row queryRow(Connection conn, string sql, ColumnSpecialization[] csa)
    Nullable!Row
    queryRow
  2. Nullable!Row queryRow(Connection conn, Prepared prepared)
  3. Nullable!Row queryRow(Connection conn, BackwardCompatPrepared prepared)

Parameters

conn Connection

An open mysql.connection.Connection to the database.

sql string

The SQL command to be run.

csa ColumnSpecialization[]

Not yet implemented.

Return Value

Type: Nullable!Row

Nullable!(mysql.result.Row): This will be null (check via Nullable.isNull) if the query resulted in an empty result set.

Detailed Description

Type Mappings

$(TYPE_MAPPINGS)

Meta