summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbintf.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-03 16:46:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-03 16:46:09 +0300
commitdd212611826b7c44e8a3c6cd2209b46d7cd03177 (patch)
treecb7c81b58576b18af8eeb7f0537aab89e6348524 /plugins/Dbx_sqlite/src/dbintf.h
parent9c11d6918afda6c9b326a794d25f65496ced081a (diff)
fix of crazy problems in SQLITE when two instances of database are running at a time
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbintf.h')
-rwxr-xr-xplugins/Dbx_sqlite/src/dbintf.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/plugins/Dbx_sqlite/src/dbintf.h b/plugins/Dbx_sqlite/src/dbintf.h
index a2a2fbcaf5..6e772eb6ef 100755
--- a/plugins/Dbx_sqlite/src/dbintf.h
+++ b/plugins/Dbx_sqlite/src/dbintf.h
@@ -4,6 +4,13 @@
#include <m_db_int.h>
+struct CQuery
+{
+ ~CQuery();
+
+ sqlite3_stmt *pQuery = nullptr;
+};
+
struct DBCachedContact : public DBCachedContactBase
{
int32_t m_count;
@@ -72,22 +79,29 @@ class CDbxSQLite : public MDatabaseCommon, public MZeroedObject
}
} m_impl;
- bool m_safetyMode, m_bReadOnly, m_bShared;
+ bool m_safetyMode, m_bReadOnly, m_bShared, m_bTranStarted;
+ // contacts
void InitContacts();
- void UninitContacts();
+ CQuery qCntCount, qCntAdd, qCntDel, qCntDelSettings, qCntDelEvents, qCntDelEventSrt;
+ // encryption
+ void InitEncryption();
+ CQuery qCryptGetMode, qCryptSetMode, qCryptGetProvider, qCryptSetProvider, qCryptGetKey, qCryptSetKey, qCryptEnc1, qCryptEnc2;
+
+ // events
LIST<char> m_modules;
void InitEvents();
void UninitEvents();
+ CQuery qEvCount, qEvAdd, qEvDel, qEvEdit, qEvBlobSize, qEvGet, qEvGetFlags, qEvSetFlags, qEvGetContact;
+ CQuery qEvFindFirst, qEvFindNext, qEvFindLast, qEvFindPrev, qEvFindUnread, qEvGetById, qEvAddSrt, qEvDelSrt, qEvMetaSplit, qEvMetaMerge;
+ // settings
void InitSettings();
- void UninitSettings();
-
- void InitEncryption();
- void UninintEncryption();
+ CQuery qSettModules, qSettWrite, qSettDel, qSettEnum, qSettChanges;
void DBFlush(bool bForce = false);
+ sqlite3_stmt* InitQuery(const char *szQuery, CQuery &stmt);
public:
CDbxSQLite(const wchar_t *pwszFileName, bool bReadOnly, bool bShared);