- Examples
- db_sqlite_examples.C.
Definition at line 253 of file SQLiteDB.h.
#include <SQLiteDB.h>
◆ table() [1/2]
KVSQLite::table::table |
( |
const TString & |
Name = "" | ) |
|
|
inline |
◆ table() [2/2]
◆ ~table()
virtual KVSQLite::table::~table |
( |
| ) |
|
|
inlinevirtual |
◆ add_column() [1/3]
◆ add_column() [2/3]
◆ add_column() [3/3]
add column to table. return reference to added column.
Definition at line 320 of file SQLiteDB.h.
◆ add_foreign_key() [1/2]
const column & KVSQLite::table::add_foreign_key |
( |
const TString & |
name, |
|
|
const table & |
other_table, |
|
|
const column & |
other_column |
|
) |
| |
add a foreign key to the table, which is an INTEGER reference to another column in another table.
- Returns
- reference to key (cannot be modified)
Definition at line 1132 of file SQLiteDB.cpp.
◆ add_foreign_key() [2/2]
add a foreign key to the table, which is an INTEGER reference to another column in another table.
- Returns
- reference to key (cannot be modified)
Definition at line 1114 of file SQLiteDB.cpp.
◆ add_primary_key()
const column & KVSQLite::table::add_primary_key |
( |
const TString & |
name | ) |
|
add a PRIMARY KEY column to the table
- Returns
- reference to primary key (cannot be modified)
- Note
- by default this is an
INTEGER
type column
-
as it is auto-incremented with each inserted row, it should not be included in TSQLStatement used to write data to db
- Examples
- db_sqlite_examples.C.
Definition at line 1092 of file SQLiteDB.cpp.
◆ check_columns()
make sure that all parameters in the list have corresponding columns in the table
- Returns
- the number of columns to be added
Definition at line 1149 of file SQLiteDB.cpp.
◆ get_insert_command()
const char * KVSQLite::table::get_insert_command |
( |
| ) |
const |
◆ has_column()
bool KVSQLite::table::has_column |
( |
const TString & |
name | ) |
const |
|
inline |
return true if column with given name exists
Definition at line 333 of file SQLiteDB.h.
◆ init_type_map()
void KVSQLite::table::init_type_map |
( |
| ) |
|
|
private |
◆ is_temporary()
bool KVSQLite::table::is_temporary |
( |
| ) |
const |
|
inline |
◆ name()
const char* KVSQLite::table::name |
( |
| ) |
const |
|
inline |
◆ number_of_columns()
int KVSQLite::table::number_of_columns |
( |
| ) |
const |
|
inline |
◆ operator[]() [1/3]
◆ operator[]() [2/3]
◆ operator[]() [3/3]
◆ prepare_data()
fill all columns in table with data contained in KVNameValueList parameters having the same name.
any columns which do not appear in the KVNameValueList will be set to 'null'
if required, any parameters with the same type&value as "null_value" will be set to 'null' too
Definition at line 1172 of file SQLiteDB.cpp.
◆ print()
void KVSQLite::table::print |
( |
| ) |
const |
|
inline |
◆ set_all_columns_null()
void KVSQLite::table::set_all_columns_null |
( |
| ) |
|
set the value of all columns in the table to NULL
Definition at line 1194 of file SQLiteDB.cpp.
◆ set_insert_mode()
The insert mode determines how to deal with errors caused by constraints The possible values of i are (with corresponding SQLite meaning):
-
if any data in row being inserted fails a constraint on one or more
columns, insertion fails with error
-
if any data in row being inserted fails a constraint on one or more
columns, the row is silently ignored (existing row unchanged)
-
if any data in row being inserted fails a constraint on one or more
columns, we replace the old row with the new one
table(const TString &Name="")
Definition at line 290 of file SQLiteDB.h.
◆ set_name()
◆ set_temporary()
void KVSQLite::table::set_temporary |
( |
bool |
temp = true | ) |
|
|
inline |
Create a temporary table
Definition at line 309 of file SQLiteDB.h.
◆ show_columns()
void KVSQLite::table::show_columns |
( |
| ) |
const |
◆ fColMap
std::unordered_map<std::string, int> KVSQLite::table::fColMap |
|
mutableprivate |
◆ fColumns
◆ fInsert
◆ fName
◆ fTemp
bool KVSQLite::table::fTemp |
|
private |
◆ type_map
The documentation for this class was generated from the following files: