BackwardCompatPrepared

This is a wrapper over mysql.prepared.Prepared, provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0 and its new connection-independent model of prepared statements. See the migration guide for more info.

In most cases, this layer shouldn't even be needed. But if you have many lines of code making calls to exec/query the same prepared statement, then this may be helpful.

To use this temporary compatability layer, change instances of:

auto stmt = conn.prepare(...);

to this:

auto stmt = conn.prepareBackwardCompat(...);

And then your prepared statement should work as before.

BUT DO NOT LEAVE IT LIKE THIS! Ultimately, you should update your prepared statement code to the mysql-native v2.0.0 API, by changing instances of:

stmt.exec()
stmt.query()
stmt.queryRow()
stmt.queryRowTuple(outputArgs...)
stmt.queryValue()

to this:

conn.exec(stmt)
conn.query(stmt)
conn.queryRow(stmt)
conn.queryRowTuple(stmt, outputArgs...)
conn.queryValue(stmt)

Both of the above syntaxes can be used with a BackwardCompatPrepared (the Connection passed directly to mysql.commands.exec/mysql.commands.query will override the one embedded associated with your BackwardCompatPrepared).

Once all of your code is updated, you can change prepareBackwardCompat back to prepare again, and your upgrade will be complete.

Alias This

_prepared

Members

Functions

exec
deprecated ulong exec()
query
deprecated ResultRange query(ColumnSpecialization[] csa)
queryRow
deprecated Nullable!Row queryRow(ColumnSpecialization[] csa)
queryRowTuple
deprecated void queryRowTuple(T args)
queryValue
deprecated Nullable!Variant queryValue(ColumnSpecialization[] csa)

This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.

Properties

prepared
Prepared prepared [@property getter]

Access underlying Prepared

Variables

_prepared
Prepared _prepared;
Undocumented in source.

Meta