Function queryRowTuple

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.

void queryRowTuple(T...) (
  Connection conn,
  const(char[]) sql,
  ref T args
);

void queryRowTuple(T...) (
  Connection conn,
  ref Prepared prepared,
  ref T args
);

This method will throw if any column type is incompatible with the corresponding D variable.

Unlike the other query functions, queryRowTuple will throw MYX if the result set is empty (and thus the reference variables passed in cannot be filled).

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

Only use the const(char[]) 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.

Type Mappings

See the MySQL/D Type Mappings tables

Parameters

NameDescription
conn An open Connection to the database.
sql The SQL command to be run.
prepared The prepared statement to be run.
args The variables, taken by reference, to receive the values.