Make SQL_LastInsertId and SQL_GetAffectedRows work on query handles, allowing their use with threaded queries

This commit is contained in:
John Schoenick
2011-05-14 20:21:37 -07:00
parent 5b45e29533
commit e8c141d775
9 changed files with 153 additions and 26 deletions
+9
View File
@@ -186,6 +186,15 @@ IQuery *SqDatabase::DoQueryEx(const char *query, size_t len)
return pQuery;
}
unsigned int SqDatabase::GetAffectedRowsForQuery(IQuery *query)
{
return static_cast<SqQuery*>(query)->GetAffectedRows();
}
unsigned int SqDatabase::GetInsertIDForQuery(IQuery *query)
{
return static_cast<SqQuery*>(query)->GetInsertID();
}
IPreparedQuery *SqDatabase::PrepareQuery(const char *query,
char *error,
size_t maxlength,
+2
View File
@@ -56,6 +56,8 @@ public:
IDBDriver *GetDriver();
bool DoSimpleQueryEx(const char *query, size_t len);
IQuery *DoQueryEx(const char *query, size_t len);
unsigned int GetAffectedRowsForQuery(IQuery *query);
unsigned int GetInsertIDForQuery(IQuery *query);
public:
sqlite3 *GetDb();
private: