1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-20 09:07:14 +02:00

More work on async statements for SQLite.

This commit is contained in:
Sandu Liviu Catalin
2022-07-23 21:41:10 +03:00
parent 49df7b75ee
commit 34a78dc166
5 changed files with 167 additions and 34 deletions

View File

@ -606,6 +606,15 @@ MySQLConnHnd::MySQLConnHnd(Poco::Data::SessionImpl * session)
mPtr = Poco::AnyCast< MYSQL * >(session->getProperty("handle"));
}
// ------------------------------------------------------------------------------------------------
MySQLConnHnd::MySQLConnHnd(Poco::AutoPtr< Poco::Data::SessionImpl > && session)
: MySQLConnHnd()
{
mSession = std::move(session);
// Retrieve the internal handle property
mPtr = Poco::AnyCast< MYSQL * >(session->getProperty("handle"));
}
// ------------------------------------------------------------------------------------------------
MySQLConnHnd::~MySQLConnHnd()
{

View File

@ -268,6 +268,11 @@ public:
*/
explicit MySQLConnHnd(Poco::Data::SessionImpl * session);
/* --------------------------------------------------------------------------------------------
* Explicit constructor.
*/
explicit MySQLConnHnd(Poco::AutoPtr< Poco::Data::SessionImpl > && session);
/* --------------------------------------------------------------------------------------------
* Destructor.
*/

View File

@ -625,16 +625,16 @@ SQLiteConnHnd::SQLiteConnHnd(Poco::Data::SessionImpl * session)
{
mSession.assign(session, true);
// Retrieve the internal handle property
mPtr = Poco::AnyCast< sqlite3 * >(session->getProperty("handle"));
mPtr = Poco::AnyCast< sqlite3 * >(mSession->getProperty("handle"));
}
// ------------------------------------------------------------------------------------------------
SQLiteConnHnd::SQLiteConnHnd(Poco::AutoPtr< Poco::Data::SessionImpl > && session)
: SQLiteConnHnd()
{
mSession == std::forward< Poco::AutoPtr< Poco::Data::SessionImpl > >(session);
mSession = std::move(session);
// Retrieve the internal handle property
mPtr = Poco::AnyCast< sqlite3 * >(session->getProperty("handle"));
mPtr = Poco::AnyCast< sqlite3 * >(mSession->getProperty("handle"));
}
// ------------------------------------------------------------------------------------------------