|
| DbExecSqlite (const string &i_connectionStr) |
| create new db-connection. More...
|
|
| ~DbExecSqlite (void) noexcept |
| close db-connection and cleanup connection resources.
|
|
string | provider (void) const override |
| return sql provider name, e.g. More...
|
|
int | selectToInt (const string &i_sql, int i_default) override |
| select integer value of first (row,column) or default if no rows or value IS NULL. More...
|
|
long long | selectToLong (const string &i_sql, long long i_default) override |
| select long value of first (row,column) or default if no rows or value IS NULL. More...
|
|
string | selectToStr (const string &i_sql) override |
| select string value of first (row,column) or empty "" string if no rows or value IS NULL. More...
|
|
bool | selectToBool (const string &i_sql) override |
| select boolean value of first (row,column) or false if no rows or value IS NULL. More...
|
|
double | selectToDouble (const string &i_sql, double i_default) override |
| select double value of first (row,column) or default if no rows or value IS NULL. More...
|
|
vector< string > | selectRowStr (const string &i_sql) override |
| select string vector of first row or empty vector if no rows, empty "" string used for NULLs. More...
|
|
IRowBaseVec | selectRowVector (const string &i_sql, const IRowAdapter &i_adapter) override |
| select vector of rows, each row created and field values set by row adapter. More...
|
|
IRowBaseList | selectRowList (const string &i_sql, const IRowAdapter &i_adapter) override |
| select list of rows, each row created and field values set by row adapter. More...
|
|
void | selectToRowProcessor (const string &i_sql, const IRowAdapter &i_adapter, IRowProcessor &i_processor) override |
| select and process rows: each row created by row adapter and passed to processor. More...
|
|
size_t | selectColumn (const string &i_sql, int i_column, const type_info &i_type, size_t i_size, void *io_valueArr) override |
| select column into io_valueArray[i_size] buffer and return row count. More...
|
|
size_t | update (const string &i_sql) override |
| execute sql statement (update, insert, delete, create, etc). More...
|
|
void | beginTransaction (void) override |
| begin transaction, throw exception if transaction already active or statement is active. More...
|
|
unique_lock< recursive_mutex > | beginTransactionThreaded (void) override |
| begin transaction in multi-threaded environment, throw exception if transaction already active or statement is active. More...
|
|
void | commit (void) override |
| commit transaction, does nothing if no active transaction, throw exception if statement is active. More...
|
|
void | rollback (void) override |
| rollback transaction, does nothing if no active transaction, throw exception if statement is active. More...
|
|
bool | isTransaction (void) override |
| return true in transaction scope. More...
|
|
void | createStatement (const string &i_sql, int i_paramCount, const type_info **i_typeArr) override |
| create new statement with specified parameters. More...
|
|
void | releaseStatement (void) noexcept override |
| release statement resources. More...
|
|
void | executeStatement (int i_paramCount, const DbValue *i_valueArr) override |
| execute statement with parameters. More...
|
|
void | runSqlScript (const string &i_sqlScript) override |
| parse and execute list of sql statements. More...
|
|
| DbExecBase (const string &i_connectionStr) |
| prepare to open new db-connection.
|
|
| ~DbExecBase (void) noexcept |
| cleanup connection resources.
|
|
bool | isTransaction (void) |
| return true in transaction scope.
|
|
virtual | ~IDbExec (void) noexcept=0 |
| close db-connection and cleanup connection resources. More...
|
|
virtual string | provider (void) const =0 |
| return sql provider name, e.g. More...
|
|
virtual int | selectToInt (const string &i_sql, int i_default)=0 |
| select integer value of first (row,column) or default if no rows or value IS NULL. More...
|
|
virtual long long | selectToLong (const string &i_sql, long long i_default)=0 |
| select long value of first (row,column) or default if no rows or value IS NULL. More...
|
|
virtual string | selectToStr (const string &i_sql)=0 |
| select string value of first (row,column) or empty "" string if no rows or value IS NULL. More...
|
|
virtual bool | selectToBool (const string &i_sql)=0 |
| select boolean value of first (row,column) or false if no rows or value IS NULL. More...
|
|
virtual double | selectToDouble (const string &i_sql, double i_default)=0 |
| select double value of first (row,column) or default if no rows or value IS NULL. More...
|
|
virtual vector< string > | selectRowStr (const string &i_sql)=0 |
| select string vector of first row or empty vector if no rows, empty "" string used for NULLs. More...
|
|
virtual IRowBaseVec | selectRowVector (const string &i_sql, const IRowAdapter &i_adapter)=0 |
| select vector of rows, each row created and field values set by row adapter. More...
|
|
virtual IRowBaseList | selectRowList (const string &i_sql, const IRowAdapter &i_adapter)=0 |
| select list of rows, each row created and field values set by row adapter. More...
|
|
virtual void | selectToRowProcessor (const string &i_sql, const IRowAdapter &i_adapter, IRowProcessor &i_processor)=0 |
| select and process rows: each row created by row adapter and passed to processor. More...
|
|
virtual size_t | selectColumn (const string &i_sql, int i_column, const type_info &i_type, size_t i_size, void *io_valueArr)=0 |
| select column into io_valueArray[i_size] buffer and return row count. More...
|
|
virtual size_t | update (const string &i_sql)=0 |
| execute sql statement (update, insert, delete, create, etc). More...
|
|
virtual void | beginTransaction (void)=0 |
| begin transaction. More...
|
|
virtual unique_lock< recursive_mutex > | beginTransactionThreaded (void)=0 |
| begin transaction in multi-threaded environment. More...
|
|
virtual void | commit (void)=0 |
| commit transaction, does nothing if no active transaction. More...
|
|
virtual void | rollback (void)=0 |
| rollback transaction. More...
|
|
virtual bool | isTransaction (void)=0 |
| return true in transaction scope. More...
|
|
virtual void | createStatement (const string &i_sql, int i_paramCount, const type_info **i_typeArr)=0 |
| create new statement with specified parameters. More...
|
|
virtual void | releaseStatement (void) noexcept=0 |
| release statement resources. More...
|
|
virtual void | executeStatement (int i_paramCount, const DbValue *i_valueArr)=0 |
| execute statement with parameters. More...
|
|
virtual void | runSqlScript (const string &i_sqlScript)=0 |
| parse and execute list of sql statements. More...
|
|
|
static IDbExec * | create (const string &i_sqlProvider, const string &i_connectionStr) |
| db-connection factory: create new db-connection. More...
|
|
static list< string > | parseListOfProviderNames (const string &i_sqlProviderNames) |
| return list of provider names from supplied comma or semicolon separated string or exception on invalid name.
|
|
static bool | isValidProviderName (const char *i_sqlProvider) |
| check if provider name is valid.
|
|
static bool | isSqlKeyword (const char *i_keyword, size_t i_length=0) |
| return true if i_keword matched one of SQL reserved keywords, comparison is case neutral and limited by i_length chars
|
|
static const string | makeDbNamePrefix (int i_id, const string &i_src) |
| make prefix part of db table name by shorten source name, ie: ageSexProvince = > ageSexPr
|
|
static const string | makeDbNameSuffix (int i_id, const string &i_src, const string i_digest) |
| make unique part of db table name by using digest or crc32(digest)
|
|
static string | bigIntTypeName (const string &i_sqlProvider) |
| return type name for BIGINT sql type
|
|
static string | floatTypeName (const string &i_sqlProvider) |
| return type name for FLOAT standard sql type
|
|
static string | textTypeName (const string &i_sqlProvider, int i_size) |
| return column type DDL for long VARCHAR columns, use it for len > 255.
|
|
static string | valueDbType (const string &i_sqlProvider, const string &i_typeName, int i_typeId) |
| return db type name by model type for specific db provider
|
|
static string | makeSqlBeginTransaction (const string &i_sqlProvider) |
| return sql statement to begin transaction (db-provider specific).
|
|
static string | makeSqlCommitTransaction (const string &i_sqlProvider) |
| return sql statement to commit transaction (db-provider specific).
|
|
static string | makeSqlCreateTableIfNotExist (const string &i_sqlProvider, const string &i_tableName, const string &i_tableBodySql) |
| make sql statement to create table if not exists. More...
|
|
static string | makeSqlCreateViewReplace (const string &i_sqlProvider, const string &i_viewName, const string &i_viewBodySql) |
| make sql statement to create or replace view. More...
|
|
static const int | maxDbTableNameSize = 63 |
| max length of db table or view name. More...
|
|
bool | isTransactionNonOwn (void) |
| return true if other thread have active transaction.
|
|
void | setTransactionActive (void) |
| set transaction ownership status.
|
|
void | releaseTransaction (void) |
| release transaction: clean active transaction status.
|
|
string | strConnProperty (const string &i_key) const |
| return string value of connection property by key (case neutral) or empty "" string if key not found.
|
|
bool | boolConnProperty (const string &i_key) const |
| return true if value of connection property is 'true', 'yes', '1' (case neutral).
|
|
long long | longConnProperty (const string &i_key, long i_default) const |
| return long value of connection property or default value if key not found (case neutral).
|
|
static void | runSqlScript (IDbExec *i_dbExec, const string &i_sqlScript) |
| parse and execute list of sql statements.
|
|
thread::id | trxThreadId |
| if true then transaction is active
|
|
NoCaseMap | connProps |
| connection properties as key+value string pairs (case neutral).
|
|
db connection wrapper for SQLite.