Function SafePrepared.setArg

Prepared statement parameter setter.

void setArg(T) (
  size_t index,
  T val,
  SafeParameterSpecialization psn = SPSN.init
)
if (!isInstanceOf!(Nullable, T) && !is(T == Variant));

void setArg(T) (
  size_t index,
  Nullable!T val,
  SafeParameterSpecialization psn = SPSN.init
);

The value may, but doesn't have to be, wrapped in a MySQLVal. If so, null is handled correctly.

The value may, but doesn't have to be, a pointer to the desired value.

The value may, but doesn't have to be, wrapped in a Nullable!T. If so, null is handled correctly.

The value can be null.

Parameter specializations (ie, for chunked transfer) can be added if required. If you wish to use chunked transfer (via psn), note that you must supply a dummy value for val that's typed ubyte[]. For example: cast(ubyte[])[].

Type Mappings

See the MySQL/D Type Mappings tables

Parameters

NameDescription
index The zero based index