mysql-native v3.0.0

API Reference Home: [This Version] [Latest Version] [Other Versions]


Struct BackwardCompatPrepared

This is a wrapper over 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.

struct BackwardCompatPrepared ;

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 exec/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.

Fields

NameTypeDescription
_prepared Prepared

Properties

NameTypeDescription
prepared[get] PreparedAccess underlying Prepared

Methods

NameDescription
exec This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.
query This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.
queryRow This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.
queryRowTuple This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.
queryValue This function is provided ONLY as a temporary aid in upgrading to mysql-native v2.0.0.