3 * ===============================================================
4 * SourceMod SQLite Driver Extension
5 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
6 * ===============================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef _INCLUDE_SQLITE_SOURCEMOD_DATABASE_H_
25 #define _INCLUDE_SQLITE_SOURCEMOD_DATABASE_H_
27 #include <IThreader.h>
30 class SqDatabase : public IDatabase
33 SqDatabase(sqlite3 *sq3, bool persistent);
37 const char *GetError(int *errorCode=NULL);
38 bool DoSimpleQuery(const char *query);
39 IQuery *DoQuery(const char *query);
40 IPreparedQuery *PrepareQuery(const char *query, char *error, size_t maxlength, int *errCode=NULL);
41 bool QuoteString(const char *str, char buffer[], size_t maxlen, size_t *newSize);
42 unsigned int GetAffectedRows();
43 unsigned int GetInsertID();
44 bool LockForFullAtomicOperation();
45 void UnlockFromFullAtomicOperation();
46 void IncReferenceCount();
47 IDBDriver *GetDriver();
52 unsigned int m_refcount;
60 #endif //_INCLUDE_SQLITE_SOURCEMOD_DATABASE_H_