1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-19 08:37:14 +02:00

Untested revised implementation of the SQLite module.

This commit is contained in:
Sandu Liviu Catalin
2016-06-15 23:49:25 +03:00
parent 166760fd46
commit 8087d0482f
17 changed files with 2235 additions and 2300 deletions

View File

@ -22,7 +22,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Construct using the direct connection handle.
*/
Transaction(const ConnHnd & db);
Transaction(const ConnRef & db);
/* --------------------------------------------------------------------------------------------
* Copy constructor. (disabled)
@ -49,6 +49,35 @@ public:
*/
Transaction & operator = (Transaction && o) = delete;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/
const String & ToString() const
{
return m_Handle ? m_Handle->mName : NullString();
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to retrieve the name from instances of this type.
*/
static SQInteger Typename(HSQUIRRELVM vm);
/* --------------------------------------------------------------------------------------------
* Retrieve the associated statement handle.
*/
const ConnRef & GetHandle() const
{
return m_Handle;
}
/* --------------------------------------------------------------------------------------------
* See whether the managed handle is valid.
*/
bool IsValid() const
{
return m_Handle;
}
/* --------------------------------------------------------------------------------------------
* Attempt to commit changes to the database.
*/
@ -65,7 +94,7 @@ public:
private:
// --------------------------------------------------------------------------------------------
ConnHnd m_Connection; // The database connection handle where the transaction began.
ConnRef m_Handle; // The database connection handle where the transaction began.
bool m_Committed; // Whether changes were successfully committed to the database.
};