#include <database-sqlite3.h>
Inheritance diagram for Database_SQLite3:
Collaboration diagram for Database_SQLite3:Public Member Functions | |
| virtual | ~Database_SQLite3 () |
| void | beginSave () override |
| void | endSave () override |
| bool | initialized () const override |
| void | verifyDatabase () override |
Protected Member Functions | |
| Database_SQLite3 (const std::string &savedir, const std::string &dbname) | |
| bool | checkTable (const char *table) |
| bool | checkColumn (const char *table, const char *column) |
| void | str_to_sqlite (sqlite3_stmt *s, int iCol, std::string_view str) const |
| void | blob_to_sqlite (sqlite3_stmt *s, int iCol, std::string_view str) const |
| void | int_to_sqlite (sqlite3_stmt *s, int iCol, int val) const |
| void | int64_to_sqlite (sqlite3_stmt *s, int iCol, s64 val) const |
| void | double_to_sqlite (sqlite3_stmt *s, int iCol, double val) const |
| std::string_view | sqlite_to_string_view (sqlite3_stmt *s, int iCol) |
| std::string | sqlite_to_string (sqlite3_stmt *s, int iCol) |
| std::string_view | sqlite_to_blob (sqlite3_stmt *s, int iCol) |
| s32 | sqlite_to_int (sqlite3_stmt *s, int iCol) |
| u32 | sqlite_to_uint (sqlite3_stmt *s, int iCol) |
| s64 | sqlite_to_int64 (sqlite3_stmt *s, int iCol) |
| u64 | sqlite_to_uint64 (sqlite3_stmt *s, int iCol) |
| float | sqlite_to_float (sqlite3_stmt *s, int iCol) |
| const v3f | sqlite_to_v3f (sqlite3_stmt *s, int iCol) |
| void | sqlite3_vrfy (int s, std::string_view m="", int r=SQLITE_OK) const |
| void | sqlite3_vrfy (const int s, const int r, std::string_view m="") const |
| virtual void | createDatabase ()=0 |
| virtual void | initStatements ()=0 |
Protected Attributes | |
| sqlite3 * | m_database = nullptr |
Private Member Functions | |
| void | openDatabase () |
Static Private Member Functions | |
| static int | busyHandler (void *data, int count) |
Private Attributes | |
| bool | m_initialized = false |
| const std::string | m_savedir |
| const std::string | m_dbname |
| sqlite3_stmt * | m_stmt_begin = nullptr |
| sqlite3_stmt * | m_stmt_end = nullptr |
| u64 | m_busy_handler_data [2] |
|
virtual |
References FINALIZE_STATEMENT, m_database, and SQLOK_ERRSTREAM.
|
protected |
|
overridevirtual |
Implements Database.
References m_stmt_begin, SQLRES, and verifyDatabase().
Referenced by AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::saveAuth(), and PlayerDatabaseSQLite3::savePlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
References sqlite3_vrfy().
Referenced by ModStorageDatabaseSQLite3::getModEntry(), ModStorageDatabaseSQLite3::hasModEntry(), ModStorageDatabaseSQLite3::removeModEntry(), MapDatabaseSQLite3::saveBlock(), and ModStorageDatabaseSQLite3::setModEntry().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
References BUSY_ERROR_INTERVAL, BUSY_FATAL_TRESHOLD, BUSY_INFO_TRESHOLD, BUSY_WARNING_TRESHOLD, errorstream, porting::getTimeMs(), infostream, and warningstream.
Referenced by openDatabase().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
References FINALIZE_STATEMENT, m_database, PREPARE_STATEMENT, sqlite_to_string_view(), and table.
Referenced by MapDatabaseSQLite3::initStatements().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
References FINALIZE_STATEMENT, m_database, PREPARE_STATEMENT, str_to_sqlite(), and table.
Referenced by MapDatabaseSQLite3::initStatements().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedpure virtual |
Implemented in AuthDatabaseSQLite3, MapDatabaseSQLite3, ModStorageDatabaseSQLite3, and PlayerDatabaseSQLite3.
Referenced by openDatabase().
Here is the caller graph for this function:
|
inlineprotected |
References sqlite3_vrfy().
Referenced by PlayerDatabaseSQLite3::savePlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Implements Database.
References m_stmt_end, SQLRES, and verifyDatabase().
Referenced by AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::saveAuth(), and PlayerDatabaseSQLite3::savePlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineoverridevirtual |
|
protectedpure virtual |
Implemented in AuthDatabaseSQLite3, MapDatabaseSQLite3, ModStorageDatabaseSQLite3, and PlayerDatabaseSQLite3.
Referenced by verifyDatabase().
Here is the caller graph for this function:
|
inlineprotected |
References sqlite3_vrfy().
Referenced by MapDatabaseSQLite3::bindPos(), AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::getAuth(), AuthDatabaseSQLite3::saveAuth(), PlayerDatabaseSQLite3::savePlayer(), and AuthDatabaseSQLite3::writePrivileges().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
References sqlite3_vrfy().
Referenced by MapDatabaseSQLite3::bindPos(), PlayerDatabaseSQLite3::loadPlayer(), and PlayerDatabaseSQLite3::savePlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References busyHandler(), fs::CreateAllDirs(), createDatabase(), DIR_DELIM, errorstream, g_settings, Settings::getU16(), itos(), m_busy_handler_data, m_database, m_dbname, m_savedir, fs::PathExists(), and SQLOK.
Referenced by verifyDatabase().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
|
inlineprotected |
References m_database.
Referenced by blob_to_sqlite(), AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::deleteAuth(), double_to_sqlite(), ModStorageDatabaseSQLite3::getModEntries(), ModStorageDatabaseSQLite3::getModKeys(), int64_to_sqlite(), int_to_sqlite(), ModStorageDatabaseSQLite3::listMods(), ModStorageDatabaseSQLite3::removeModEntries(), ModStorageDatabaseSQLite3::removeModEntry(), PlayerDatabaseSQLite3::removePlayer(), AuthDatabaseSQLite3::saveAuth(), PlayerDatabaseSQLite3::savePlayer(), sqlite3_vrfy(), str_to_sqlite(), and AuthDatabaseSQLite3::writePrivileges().
Here is the caller graph for this function:
|
inlineprotected |
Referenced by ModStorageDatabaseSQLite3::getModEntries(), ModStorageDatabaseSQLite3::getModEntry(), ModStorageDatabaseSQLite3::getModKeys(), and MapDatabaseSQLite3::loadBlock().
Here is the caller graph for this function:
|
inlineprotected |
Referenced by PlayerDatabaseSQLite3::loadPlayer(), and sqlite_to_v3f().
Here is the caller graph for this function:
|
inlineprotected |
Referenced by MapDatabaseSQLite3::listAllLoadableBlocks(), and PlayerDatabaseSQLite3::loadPlayer().
Here is the caller graph for this function:
|
inlineprotected |
Referenced by AuthDatabaseSQLite3::getAuth(), and MapDatabaseSQLite3::listAllLoadableBlocks().
Here is the caller graph for this function:
|
inlineprotected |
References sqlite_to_string_view().
Referenced by PlayerDatabaseSQLite3::loadPlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
Referenced by checkColumn(), AuthDatabaseSQLite3::getAuth(), ModStorageDatabaseSQLite3::listMods(), AuthDatabaseSQLite3::listNames(), PlayerDatabaseSQLite3::listPlayers(), PlayerDatabaseSQLite3::loadPlayer(), and sqlite_to_string().
Here is the caller graph for this function:
|
inlineprotected |
Referenced by AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::getAuth(), and PlayerDatabaseSQLite3::loadPlayer().
Here is the caller graph for this function:
|
inlineprotected |
|
inlineprotected |
References sqlite_to_float().
Referenced by PlayerDatabaseSQLite3::loadPlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprotected |
References sqlite3_vrfy().
Referenced by checkTable(), AuthDatabaseSQLite3::createAuth(), AuthDatabaseSQLite3::deleteAuth(), AuthDatabaseSQLite3::getAuth(), ModStorageDatabaseSQLite3::getModEntries(), ModStorageDatabaseSQLite3::getModEntry(), ModStorageDatabaseSQLite3::getModKeys(), ModStorageDatabaseSQLite3::hasModEntry(), PlayerDatabaseSQLite3::loadPlayer(), PlayerDatabaseSQLite3::playerDataExists(), ModStorageDatabaseSQLite3::removeModEntries(), ModStorageDatabaseSQLite3::removeModEntry(), PlayerDatabaseSQLite3::removePlayer(), AuthDatabaseSQLite3::saveAuth(), PlayerDatabaseSQLite3::savePlayer(), ModStorageDatabaseSQLite3::setModEntry(), and AuthDatabaseSQLite3::writePrivileges().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Reimplemented from Database.
References initStatements(), m_initialized, openDatabase(), and PREPARE_STATEMENT.
Referenced by beginSave(), AuthDatabaseSQLite3::deleteAuth(), MapDatabaseSQLite3::deleteBlock(), endSave(), AuthDatabaseSQLite3::getAuth(), ModStorageDatabaseSQLite3::getModEntries(), ModStorageDatabaseSQLite3::getModEntry(), ModStorageDatabaseSQLite3::getModKeys(), ModStorageDatabaseSQLite3::hasModEntry(), MapDatabaseSQLite3::listAllLoadableBlocks(), ModStorageDatabaseSQLite3::listMods(), AuthDatabaseSQLite3::listNames(), PlayerDatabaseSQLite3::listPlayers(), MapDatabaseSQLite3::loadBlock(), PlayerDatabaseSQLite3::loadPlayer(), PlayerDatabaseSQLite3::playerDataExists(), ModStorageDatabaseSQLite3::removeModEntries(), ModStorageDatabaseSQLite3::removeModEntry(), MapDatabaseSQLite3::saveBlock(), and ModStorageDatabaseSQLite3::setModEntry().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by openDatabase().
|
protected |
Referenced by ~Database_SQLite3(), checkColumn(), checkTable(), AuthDatabaseSQLite3::createDatabase(), MapDatabaseSQLite3::createDatabase(), ModStorageDatabaseSQLite3::createDatabase(), PlayerDatabaseSQLite3::createDatabase(), AuthDatabaseSQLite3::deleteAuth(), MapDatabaseSQLite3::deleteBlock(), ModStorageDatabaseSQLite3::getModEntries(), ModStorageDatabaseSQLite3::getModKeys(), ModStorageDatabaseSQLite3::listMods(), openDatabase(), ModStorageDatabaseSQLite3::removeModEntries(), ModStorageDatabaseSQLite3::removeModEntry(), and sqlite3_vrfy().
|
private |
Referenced by openDatabase().
|
private |
Referenced by initialized(), and verifyDatabase().
|
private |
Referenced by openDatabase().
|
private |
Referenced by beginSave().
|
private |
Referenced by endSave().