Abscissa / mysql-native-experimental

OUTDATED: Use the official mysql-native: https://github.com/mysql-d/mysql-native
4 stars 0 forks source link

is there any way to print SQL query? #6

Open bubnenkoff opened 7 years ago

bubnenkoff commented 7 years ago

I want to print query body (possible in Exception text) or maybe after setting prepared args for test purposes.

By code look in next way:

try
{    
PerformerStruct performerStruct;
 Prepared prepared = prepare(database.connection, `SELECT id, login, password, sex, age, city from performers WHERE id=?`);

I know that I can create text variable with SELECT id, login, password, sex, age, city from performers WHERE id=? on top of try and than do:

string myVariableWithSQLQuery = "SELECT id, login, password, sex, age, city from performers WHERE id=?"
try{
...
 Prepared prepared = prepare(database.connection, myVariableWithSQLQuery);

But it's look ugly. Can I print already prepared query like: writeln(prepared.SQLContent);

?

Abscissa commented 7 years ago

Not currently. But you're right, there should be. Will fix.