HDK
|
#include <UT_SQL.h>
Public Member Functions | |
virtual | ~UT_SqlBaseDriver ()=default |
UT_NON_COPYABLE (UT_SqlBaseDriver) | |
virtual void | setHostName (const UT_StringHolder &host) |
virtual void | setPort (int port) |
virtual void | setUserName (const UT_StringHolder &user) |
virtual void | setPassword (const UT_StringHolder &password) |
virtual void | setDatabaseName (const UT_StringHolder &db_name) |
virtual void | setConnectOptions (const UT_Options &options) |
virtual bool | connect (UT_ErrorCode *ec=nullptr)=0 |
virtual bool | close (UT_ErrorCode *ec=nullptr)=0 |
virtual NO_DISCARD bool | isValid () const =0 |
virtual NO_DISCARD bool | isReadOnly (const char *db="main", UT_ErrorCode *ec=nullptr) const =0 |
virtual NO_DISCARD void * | nativeAPI ()=0 |
virtual NO_DISCARD void * | nativeAPI () const =0 |
virtual NO_DISCARD UT_SharedPtr < UT_SqlStatementImpl > | createStatementImpl ()=0 |
virtual NO_DISCARD UT_SharedPtr < UT_SqlStatementImpl > | createStatementImpl () const =0 |
virtual NO_DISCARD bool | tableExists (const UT_StringRef &name, UT_ErrorCode *ec=nullptr) const =0 |
Check if the specified table exists. More... | |
virtual NO_DISCARD bool | indexExists (const UT_StringRef &name, UT_ErrorCode *ec=nullptr) const =0 |
virtual NO_DISCARD bool | viewExists (const UT_StringRef &name, UT_ErrorCode *ec=nullptr) const =0 |
virtual NO_DISCARD bool | columnExists (const UT_StringRef &table_name, const UT_StringRef &column_name, UT_ErrorCode *ec=nullptr) const =0 |
virtual NO_DISCARD UT_StringHolder | errorMessage () const =0 |
virtual NO_DISCARD int | errorCode () const =0 |
virtual NO_DISCARD int | extendedErrorCode () const =0 |
virtual bool | startTransaction (UT_ErrorCode *ec=nullptr)=0 |
virtual bool | endTransaction (bool commit, UT_ErrorCode *ec=nullptr)=0 |
virtual UT_SharedPtr < UT_SqlStatementImpl > | cachedStatement (const UT_SqlStatementHandleId &id, const UT_StringRef &sql, UT_ErrorCode *ec=nullptr) const =0 |
virtual UT_SharedPtr < UT_SqlStatementImpl > | findCachedStatement (const UT_SqlStatementHandleId &id) const =0 |
virtual NO_DISCARD UT_StringHolder | getSchema (UT_ErrorCode *ec=nullptr) const =0 |
template<typename... Args> | |
bool | run (UT_ErrorCode *ec, const UT_StringRef &sql, Args &&...args) |
Helper function to run an sql statement with provided typed args. More... | |
virtual int | exec (const UT_StringRef &sql, UT_ErrorCode *ec=nullptr) const =0 |
Returns the number of rows modified, inserted or deleted. More... | |
Protected Member Functions | |
UT_SqlBaseDriver ()=default | |
|
virtualdefault |
|
protecteddefault |
|
pure virtual |
Get a sql statement that is retrieved from the cache. If the statement is not already cached then its compiled and then cached if the compiled statement is valid.
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Returns the number of rows modified, inserted or deleted.
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Find an sql handle based on its id. The sql statement must have already been added from cachedStatement(). This method is typically used when a statement has already been compiled and added to the cache but needs to be dynamically looked up some time later.
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
pure virtual |
Implemented in UT_SqliteDriver.
|
inline |
|
inlinevirtual |
Reimplemented in UT_SqliteDriver.
|
inlinevirtual |
Reimplemented in UT_SqliteDriver.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
pure virtual |
These are primarily used by UT_SqlTransaction (but can be used by any client code) and provide an abstraction that resembles nested transations. This is inspired by (and follows the same behaviour as): https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#beginTransaction()
Implemented in UT_SqliteDriver.
|
pure virtual |
Check if the specified table exists.
Implemented in UT_SqliteDriver.
UT_SqlBaseDriver::UT_NON_COPYABLE | ( | UT_SqlBaseDriver | ) |
|
pure virtual |
Implemented in UT_SqliteDriver.