Implement the query execution functions on MySQL connection.

Minor adjustments in comments.
This commit is contained in:
Sandu Liviu Catalin
2016-06-03 22:17:52 +03:00
parent 2f16d63e2a
commit 525148ccd1
7 changed files with 133 additions and 16 deletions
+24 -6
View File
@@ -8,7 +8,7 @@
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
* ...
* Allows management and interaction with a connection handle.
*/
class Connection
{
@@ -50,7 +50,10 @@ public:
/* --------------------------------------------------------------------------------------------
* Destructor.
*/
~Connection() = default;
~Connection()
{
// Let the handle deal with closing the connection if necessary
}
/* --------------------------------------------------------------------------------------------
* Copy assignment operator.
@@ -133,6 +136,16 @@ public:
m_Handle->Disconnect();
}
/* --------------------------------------------------------------------------------------------
* Retrieve the current error number.
*/
SQInteger GetErrNo() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the current error message.
*/
CSStr GetErrStr() const;
/* --------------------------------------------------------------------------------------------
* Retrieve the last received error number.
*/
@@ -338,22 +351,27 @@ public:
/* --------------------------------------------------------------------------------------------
* Execute a query on the server.
*/
SQInteger Execute(CSStr query);
Object Execute(CSStr query);
/* --------------------------------------------------------------------------------------------
* Execute a query on the server.
*/
SQInteger Insert(CSStr query);
Object Insert(CSStr query);
/* --------------------------------------------------------------------------------------------
* Execute a query on the server.
*/
SQInteger Query(CSStr query);
ResultSet Query(CSStr query);
/* --------------------------------------------------------------------------------------------
*
* Create a new statement on the managed connection.
*/
Statement GetStatement(CSStr query);
/* --------------------------------------------------------------------------------------------
* Create a new transaction on the managed connection.
*/
Transaction GetTransaction();
};
} // Namespace:: SqMod