16 using namespace std::chrono_literals;
25 bool database::debug =
false;
28 std::map<TString, KVSQLite::column_type::types> table::type_map;
29 std::map<KVSQLite::column_type::types, TString> column::inv_type_map;
45 TString _query =
"SELECT " + double_quote_all_tables_and_columns(columns) +
" FROM " + double_quote_all_tables_and_columns(
table);
46 if (condition !=
"") _query +=
" WHERE " + double_quote_all_tables_and_columns(condition);
55 void database::read_table_infos()
58 std::unique_ptr<TList> tl(fDBserv->GetTablesList());
60 TIter it_tab(tl.get());
61 while ((o = it_tab())) {
65 std::unique_ptr<TSQLResult> columnRes(fDBserv->GetColumns(
"", o->
GetName()));
66 if (!columnRes.get()) {
67 Error(
"read_table_infos",
"Cannot get information on columns for table %s", o->
GetName());
70 std::unique_ptr<TSQLRow> columnRow(columnRes->Next());
71 while ((columnRow.get()) !=
nullptr) {
73 TString primary_key(columnRow->GetField(5));
75 columnRow.reset(columnRes->Next());
77 fTables.insert(std::pair<std::string, KVSQLite::table>(o->
GetName(), t));
78 (*this)[t.
name()].fDB =
this;
81 for (
auto&
p : fTables) {
82 TString qry =
Form(
"PRAGMA foreign_key_list('%s')",
p.second.name());
86 std::unique_ptr<TSQLRow> row(
result->Next());
88 TString parent_table(row->GetField(2));
89 TString child_key(row->GetField(3));
90 TString parent_key(row->GetField(4));
91 p.second.foreign_key(child_key, parent_table, parent_key);
94 p.second.set_foreign_key_back_references();
103 void database::show_tables()
const
106 std::cout <<
"Tables in database:" << std::endl;
107 for (
auto it = fTables.begin();
108 it != fTables.end(); ++it) {
109 std::cout <<
"\t" << it->first << std::endl;
138 Error(
"open",
"problem with SQLite database filename: %s", dbfile.
Data());
142 TString uri =
"sqlite://" + exp_path;
145 if (!execute(
"pragma schema_version")) {
146 if (fDBserv->IsLocked()) {
151 Info(
"open",
"Database is locked. Try again in 1s...");
152 std::this_thread::sleep_for(1s);
153 Info(
"open",
"Try number %d...", i);
156 while (!execute(
"pragma schema_version") && fDBserv->IsLocked() && (i < 10));
157 if ((i < 10) && fDBserv->IsOK()) {
158 Info(
"open",
"...database successfully opened");
176 void database::PrintResults(
TSQLResult* tabent,
int column_width)
const
179 std::unique_ptr<TSQLRow> row(
nullptr);
180 for (
int r = -1;
true; ++
r) {
182 row.reset(tabent->
Next());
183 if (row.get() ==
nullptr)
break;
184 std::cout << std::setw(6) <<
r;
186 for (
int f = 0;
f < nfields; ++
f) {
188 if (
f == 0) std::cout << std::setw(6) <<
"#";
189 std::cout <<
"|" << std::setw(column_width) << tabent->
GetFieldName(
f) ;
192 std::cout <<
"|" << std::setw(column_width) << row->GetField(
f) ;
204 void database::Dump()
const
208 std::cout <<
"Database : " << fDBserv->GetDB() <<
" [" << fDBserv->GetDBMS() <<
"]\n";
209 std::unique_ptr<TList> tl(fDBserv->GetTablesList());
211 TIter it_tab(tl.get());
212 while ((o = it_tab())) {
214 std::cout <<
"Table : " << o->
GetName() <<
"\n";
215 std::unique_ptr<TSQLResult> tabent = SelectRowsFromTable(o->
GetName());
216 PrintResults(tabent.get());
218 std::cout << std::endl;
229 std::unique_ptr<TSQLResult> tabent = SelectRowsFromTable(
table, columns, condition);
230 PrintResults(tabent.get(), column_width);
231 std::cout << std::endl;
275 std::cout << command << std::endl;
276 if (execute(command)) {
277 fTables.insert(std::pair<std::string, KVSQLite::table>(t.
name(), t));
278 (*this)[t.
name()].fDB =
this;
279 (*this)[t.
name()].set_foreign_key_back_references();
281 return (*
this)[t.
name()];
321 if (debug)
Info(
"prepare_data_insertion",
"table=%s",
table.Data());
324 Error(
"database::prepare_data_insertion",
325 "bulk insertion in progress for table %s; call database::commit() to terminate transaction",
330 Error(
"database::prepare_data_insertion",
331 "bulk insertion in progress; call database::commit() to terminate transaction");
336 Error(
"database::prepare_data_insertion",
337 "data retrieval in progress; call get_next_result() until it returns false");
341 fDBserv->StartTransaction();
343 fBulkTable = &fTables[
table.Data()];
344 TString com(fBulkTable->get_insert_command());
345 int ncol = fBulkTable->number_of_columns();
347 for (
int i = 0; i < ncol; ++i) {
349 if (!(*fBulkTable)[i].rowid_alias()) {
350 com +=
Form(
"\"%s\"", (*fBulkTable)[i].
name());;
356 for (
int i = 0; i < ncol; ++i) {
358 if (!(*fBulkTable)[i].rowid_alias()) {
364 if (debug) std::cout << com << std::endl;
365 return prepare_statement(com);
395 bool database::prepare_data_insertion_selected_columns(
const TString&
table)
421 if (debug)
Info(
"prepare_data_insertion_selected_columns",
"table=%s",
table.Data());
424 Error(
"database::prepare_data_insertion",
425 "bulk insertion in progress for table %s; call database::commit() to terminate transaction",
430 Error(
"database::prepare_data_insertion",
431 "bulk insertion in progress; call database::commit() to terminate transaction");
436 Error(
"database::prepare_data_insertion",
437 "data retrieval in progress; call get_next_result() until it returns false");
441 fDBserv->StartTransaction();
443 fBulkTable = &fTables[
table.Data()];
444 TString com(fBulkTable->get_insert_command());
445 int ncol = fBulkTable->number_of_columns();
447 for (
int i = 0; i < ncol; ++i) {
449 if (!(*fBulkTable)[i].rowid_alias() && (*fBulkTable)[i].has_data) {
450 com +=
Form(
"\"%s\"", (*fBulkTable)[i].
name());;
456 for (
int i = 0; i < ncol; ++i) {
458 if (!(*fBulkTable)[i].rowid_alias() && (*fBulkTable)[i].has_data) {
464 if (debug) std::cout << com << std::endl;
465 return prepare_statement(com);
472 const char* table::get_insert_command()
const
476 return Form(
"INSERT OR FAIL INTO \"%s\"(",
name());
479 return Form(
"INSERT OR IGNORE INTO \"%s\"(",
name());
482 return Form(
"INSERT OR REPLACE INTO \"%s\"(",
name());
488 return Form(
"INSERT INTO \"%s\"(",
name());
507 decl.
Form(
"\"%s\" %s",
name(), TypeName().Data());
508 if (!fConstraint.IsNull()) {
529 void database::insert_data_row()
542 if (!fInserting || !fBulkTable) {
543 Error(
"database::insert_data_row",
544 "no transaction initialized; call prepare_data_insertion(name_table) before this method");
548 Error(
"database::insert_data_row",
549 "data retrieval in progress; call get_next_result() until it returns false, then call prepare_data_insertion(name_table) before this method");
552 int ncol = fBulkTable->number_of_columns();
553 fSQLstmt->NextIteration();
555 for (
int i = 0; i < ncol; ++i) {
556 if (!(*fBulkTable)[i].rowid_alias()) {
557 (*fBulkTable)[i].set_data_in_statement(fSQLstmt.get(), idx);
576 void database::insert_data_row_selected_columns()
589 if (!fInserting || !fBulkTable) {
590 Error(
"database::insert_data_row",
591 "no transaction initialized; call prepare_data_insertion(name_table) before this method");
595 Error(
"database::insert_data_row",
596 "data retrieval in progress; call get_next_result() until it returns false, then call prepare_data_insertion(name_table) before this method");
599 int ncol = fBulkTable->number_of_columns();
600 fSQLstmt->NextIteration();
602 for (
int i = 0; i < ncol; ++i) {
603 if (!(*fBulkTable)[i].rowid_alias() && (*fBulkTable)[i].has_data) {
604 (*fBulkTable)[i].set_data_in_statement(fSQLstmt.get(), idx);
616 void database::end_data_insertion()
621 if (debug)
Info(
"end_data_insertion",
"now");
623 Error(
"database::end_data_insertion",
624 "no transaction initialized; call prepare_data_insertion(name_table) first");
628 Error(
"database::insert_data_row",
629 "data retrieval in progress; call get_next_result() until it returns false, then call prepare_data_insertion(name_table) before this method");
632 fBulkTable =
nullptr;
642 void database::print_selected_data(
const TString& tables,
const TString& columns,
const TString& selection,
bool distinct,
const TString& anything_else)
646 if (select_data(tables, columns, selection, distinct, anything_else)) {
648 std::vector<TString> col_titles;
649 std::vector<int> col_width;
650 std::for_each(std::begin(fSQLstmtCols), std::end(fSQLstmtCols),
651 [&col_titles, &col_width]
658 using data_row = std::vector<TString>;
659 std::vector<data_row> col_data;
660 while (get_next_result()) {
661 data_row current_data_row;
663 std::for_each(std::begin(fSQLstmtCols), std::end(fSQLstmtCols),
664 [&col_index, &col_width, ¤t_data_row]
667 col_width[col_index] = std::max(current_data_row[col_index].Length(), col_width[col_index]);
671 col_data.push_back(current_data_row);
673 auto print_line = [&col_width]() {
674 for (
auto width : col_width) {
676 for (
int i = 0; i <=
width; ++i) std::cout <<
"-";
680 auto print_column_item = [](
const TString & item,
int width,
bool end_line =
false) {
681 std::cout <<
"| " << item;
682 for (
int i = 0; i <=
width - item.Length(); ++i)
687 auto print_column_data = [&col_width, &print_column_item](
const std::vector<TString>& cols) {
689 int ncols = cols.size();
690 for (
auto& col : cols) {
691 print_column_item(col, col_width[col_index], (col_index == ncols - 1));
694 std::cout << std::endl;
697 print_column_data(col_titles);
699 for (
auto& row : col_data) print_column_data(row);
708 std::list<const table*> database::generate_table_selection_string(
const TString& tables,
KVString& table_selection)
const
710 std::list<const table*> table_list;
715 std::unordered_map<std::string, int> table_names;
716 while (!_tables.
End()) {
718 table_list.push_back(&
operator[](tabnam));
720 table_selection +=
" INNER JOIN \"" + tabnam +
"\"";
722 auto this_table = table_list.back();
723 if (this_table->has_foreign_keys(
false)) {
725 for (
auto&
f : this_table->fForeignKeys) {
727 if (table_names[
f.parent_table.Data()]) {
728 table_selection +=
Form(
" %s %s.%s = %s.%s",
730 this_table->name(),
f.child_key.Data(),
731 f.parent_table.Data(),
f.parent_key.Data());
738 table_selection +=
"\"" + tabnam +
"\"";
739 ++table_names[tabnam.
Data()];
751 auto replacer = [&](
const KVString & repl) {
755 while (!repl.End()) {
756 auto tok = repl.Next();
757 if (replaced.
Length()) replaced +=
" ";
758 bool stop_replacing =
false;
759 for (
auto& tp : fTables) {
760 TString table_name = tp.second.name();
761 if (tok == table_name) {
764 stop_replacing =
true;
767 for (
auto&
c : tp.second.fColumns) {
769 if (tok == column_name) {
772 stop_replacing =
true;
776 if (stop_replacing)
break;
787 while (!_input.
End()) {
788 auto part = _input.
Next();
790 output += replacer(part);
793 output +=
"'" + part +
"'";
795 in_quotes = !in_quotes;
843 if (debug)
Info(
"select_data",
"tables=%s columns=%s selection=%s anything_else=%s",
846 Error(
"database::select_data",
847 "data insertion in progress; call end_data_insertion() before retrieving data");
851 Error(
"database::select_data",
852 "data retrieval already in progress; call get_next_result() until it returns false before making new selection");
856 fSQLstmtCols.clear();
859 std::list<const table*> table_list = generate_table_selection_string(tables, table_selection);
861 KVString column_selection(
""), _columns(columns);
862 if (columns ==
"*") {
863 column_selection =
"*";
867 for (
auto tabs : table_list) {
868 for (
int i = 0; i < tabs->number_of_columns(); ++i) {
869 fSQLstmtCols.push_back(&(*tabs)[i]);
874 if (distinct) column_selection =
"DISTINCT ";
877 while (!_columns.
End()) {
879 if (i) column_selection +=
", ";
886 column_selection +=
Form(
"%s", colnam.
Data());
887 fSQLstmtCols.push_back(&count_column);
891 column_selection +=
Form(
"\"%s\"", colnam.
Data());
892 for (
auto tabs : table_list)
893 if (tabs->has_column(colnam)) fSQLstmtCols.push_back(&(*tabs)[colnam]);
898 TString cond =
Form(
"SELECT %s FROM %s", column_selection.Data(), table_selection.
Data());
899 if (selection !=
"") {
901 cond +=
" WHERE " + double_quote_all_tables_and_columns(selection);
903 if (anything_else !=
"") {
905 cond +=
" " + double_quote_all_tables_and_columns(anything_else);
908 std::cout << cond << std::endl;
909 prepare_statement(cond);
910 if (fSQLstmt.get() ==
nullptr) {
911 Error(
"database::select_data",
"problem processing : %s", cond.
Data());
913 fBulkTable =
nullptr;
916 fSQLstmt->EnableErrorOutput();
917 if (fSQLstmt->Process()) {
918 fSQLstmt->StoreResult();
920 fEmptyResultSet =
false;
923 else if (!fSQLstmt->IsError()) {
925 fSQLstmt->StoreResult();
927 fEmptyResultSet =
true;
931 fBulkTable =
nullptr;
941 bool database::get_next_result()
const
946 if (debug)
Info(
"get_next_result",
"now");
948 Error(
"database::get_next_result",
949 "data insertion in progress; call end_data_insertion() then select_data() before this method");
953 Error(
"database::get_next_result",
954 "no data retrieval in progress; select_data() must be called and return true before calling this method");
957 if (!fEmptyResultSet && fSQLstmt->NextResultRow()) {
960 for (
auto col : fSQLstmtCols) {
961 col->set_data_from_statement(fSQLstmt.get(), idx);
966 fBulkTable =
nullptr;
982 if (
column.Contains(
",")) {
983 Error(
"database::get_integer_list",
"Only 1 column name at a time please!");
987 if (select_data(tables,
column, selection,
true, anything_else)) {
988 auto column_data = fSQLstmtCols.front();
989 while (get_next_result()) {
990 result.Add(column_data->get_data<
int>());
1009 if (
column.Contains(
",")) {
1010 Error(
"database::get_string_list",
"Only 1 column name at a time please!");
1014 if (select_data(tables,
column, selection,
false, anything_else)) {
1015 auto column_data = fSQLstmtCols.front();
1016 while (get_next_result()) {
1017 if (column_data->is_null())
continue;
1039 if (select_data(tablename,
Form(
"%s,%s", name_column.
Data(), value_column.
Data()), selection,
false, anything_else)) {
1040 auto it = fSQLstmtCols.begin();
1043 while (get_next_result()) {
1061 if (select_data(tablename,
Form(
"%s,%s", Xcolumn.
Data(), Ycolumn.
Data()), selection)) {
1064 auto it = fSQLstmtCols.begin();
1067 while (get_next_result()) {
1068 g->SetPoint(i++, Xcol->get_data<
double>(), Ycol->get_data<
double>());
1083 delete_rows_in_table(
name);
1135 if (debug)
Info(
"count",
"tables=%s column=%s selection=%s anything_else=%s",
1137 TString qry =
"SELECT count(";
1138 if (distinct &&
column !=
"*") qry +=
"DISTINCT ";
1143 generate_table_selection_string(tables, table_selection);
1144 qry += table_selection;
1145 if (selection !=
"") {
1146 qry +=
" WHERE " + double_quote_all_tables_and_columns(selection);
1148 if (anything_else !=
"") {
1149 qry +=
" " + double_quote_all_tables_and_columns(anything_else);
1151 if (debug) std::cout << qry << std::endl;
1152 auto result = query(qry);
1153 std::unique_ptr<TSQLRow> row(
result->Next());
1154 TString number = row->GetField(0);
1155 return number.
Atoi();
1179 if (debug)
Info(
"update",
"table=%s columns=%s selection=%s",
table.Data(), columns.
Data(), selection.
Data());
1181 Error(
"database::update",
1182 "data insertion in progress; call end_data_insertion() before doing anything else");
1186 Error(
"database::update",
1187 "data retrieval in progress; call get_next_result() until it returns false before doing anything else");
1191 fBulkTable = &fTables[
table.Data()];
1193 int ncol = fBulkTable->number_of_columns();
1195 for (
int i = 0; i < ncol; ++i) {
1196 if (columns.
Contains((*fBulkTable)[i].name())) {
1197 if (idx) query +=
",";
1198 query +=
Form(
"\"%s\"", (*fBulkTable)[i].
name());
1203 if (selection !=
"") query +=
" WHERE " + double_quote_all_tables_and_columns(selection);
1204 if (debug) std::cout << query << std::endl;
1205 if (!prepare_statement(query))
1207 fSQLstmt->NextIteration();
1209 for (
int i = 0; i < ncol; ++i) {
1210 if (columns.
Contains((*fBulkTable)[i].name())) {
1211 (*fBulkTable)[i].set_data_in_statement(fSQLstmt.get(), idx);
1215 return (fSQLstmt->Process());
1259 if (debug)
Info(
"delete_data",
"table=%s selection=%s",
1262 if (selection !=
"") query +=
" WHERE " + double_quote_all_tables_and_columns(selection);
1293 Error(
"database::add_missing_columns",
1294 "data insertion in progress; call end_data_insertion() before doing anything else");
1298 Error(
"database::add_missing_columns",
1299 "data retrieval in progress; call get_next_result() until it returns false before doing anything else");
1302 int ipar =
l.GetNpar();
1303 table& tab = (*this)[_table_];
1304 for (
int i = 0; i < ipar; ++i) {
1330 if (COLUMNS !=
"*") {
1334 _columns.
Begin(
",");
1335 while (!_columns.
End()) {
1336 if (COLUMNS !=
"") COLUMNS +=
", ";
1340 TString query =
Form(
"INSERT INTO \"%s\" SELECT %s FROM \"%s\"", destination.
Data(), COLUMNS.
Data(), source.
Data());
1341 if (selection !=
"") query +=
" WHERE " + double_quote_all_tables_and_columns(selection);
1349 void column::init_type_map()
1364 return inv_type_map[fNameType.second];
1373 fData.Set(
x.GetName(),
x);
1393 if (idx < 0) idx =
index();
1401 s->SetDouble(idx, fData.GetDouble());
1404 s->SetInt(idx, fData.GetInt());
1408 s->SetString(idx, fData.GetString(), -1);
1411 s->SetBinary(idx, fBlob, fBlobSize);
1442 if (idx < 0) idx =
index();
1443 fIsNull = s->IsNull(idx);
1446 fData.Set(fIsNull ? 0.0 : s->GetDouble(idx));
1449 fData.Set(fIsNull ? 0 : s->GetInt(idx));
1453 fData.Set(fIsNull ?
"" : s->GetString(idx));
1460 if (!fBlob) fBlob = (
void*)
new unsigned char[256];
1461 s->GetBinary(idx, fBlob, fBlobSize);
1481 if (fData.IsString()) {
1482 auto r = fData.GetTString();
1483 r.ReplaceAll(
"''",
"~#%");
1484 r.ReplaceAll(
"'",
"''");
1485 r.ReplaceAll(
"~#%",
"''");
1486 return Form(
"'%s'",
r.Data());
1488 return fData.GetTString();
1495 void table::init_type_map()
1512 void table::set_foreign_key_back_references()
1519 for (
auto&
f : fForeignKeys)
1520 fDB->get_table(
f.parent_table).fForeignKeys.push_back({
f.parent_key,
name(),
f.child_key,
true});
1552 if (is_temporary()) command +=
"TEMPORARY ";
1554 command +=
"TABLE ";
1555 command +=
"\"" + fName +
"\"";
1557 for (
int i = 0; i < number_of_columns(); ++i) {
1559 command += fColumns[i].get_declaration();
1560 if (i < number_of_columns() - 1) command +=
",";
1562 if (has_primary_key()) {
1563 command +=
",\n PRIMARY KEY(";
1564 command +=
"\"" + fPrimaryKey +
"\"";
1567 if (has_foreign_keys()) {
1569 for (
auto& fk : fForeignKeys) {
1570 command +=
",\n FOREIGN KEY(";
1571 command +=
"\"" + fk.child_key +
"\"";
1572 command +=
") REFERENCES ";
1573 command +=
"\"" + fk.parent_table +
"\"";
1574 if (!fk.parent_key.IsNull()) {
1576 command +=
"\"" + fk.parent_key +
"\"";
1590 void table::show_columns()
const
1593 std::cout <<
"Columns in table:" << std::endl;
1595 for (
auto it = fColumns.begin(); it != fColumns.end(); ++it) {
1597 for (std::vector<KVSQLite::column>::const_iterator it = fColumns.begin(); it != fColumns.end(); ++it) {
1599 std::cout <<
"\t" << it->name() <<
" [" << it->TypeName() <<
"]" << std::endl;
1615 fColumns.push_back(
c);
1616 fColMap[
c.name()] =
c.index();
1617 fColumns.back().set_table(
name());
1618 return fColumns.back();
1633 return add_column(
name, type_map[
type]);
1685 KVString check_columns = child_key;
1686 check_columns.
Begin(
",");
1688 while (!check_columns.
End()) {
1690 if (!has_column(nxt)) {
1691 Error(
"table::foreign_key",
"Child key \"%s\" has not being declared with add_column()", nxt.Data());
1696 fForeignKeys.push_back({child_key, parent_table, parent_key});
1711 int ipar =
l.GetNpar();
1712 for (
int i = 0; i < ipar; ++i) {
1714 if (!has_column(par->
GetName())) ncols++;
1736 for (
int i = 0; i < number_of_columns(); ++i) {
1738 if (
p && !(null_value &&
p->HasSameValueAs(*null_value)))
1739 (*
this)[i].set_data(*
p);
1741 (*
this)[i].set_null();
1750 void table::set_all_columns_null()
1753 for (
int i = 0; i < number_of_columns(); ++i) {
1754 (*this)[i].set_null();
1775 for (
int i = 0; i < number_of_columns(); ++i) {
1778 if (added) namelist += delim;
1797 void table::prepare_insert_single_row()
1808 for (
auto& col : fColumns) col.has_data =
false;
1816 void table::insert_single_row()
1820 if (database::debug)
Info(
"insert_single_row",
"table=%s",
name());
1821 TString query = get_insert_command();
1823 for (
auto& col : fColumns) {
1825 if (ncols) query +=
",";
1826 query +=
"\"" + col.Name() +
"\"";
1830 query +=
") VALUES (";
1832 for (
auto& col : fColumns) {
1834 if (ncols) query +=
",";
1835 query += col.get_data_string_for_insert();
1840 if (database::debug) std::cout << query << std::endl;
1841 fDB->execute(query);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
A generic named parameter storing values of different types.
const Char_t * GetSQLType() const
TString GetTString() const
Strings used to represent a set of ranges of values.
Modified copy of TSQLiteServer.
const char * name() const
const KVNamedParameter & data() const
TString get_table() const
Interface to ROOT SQLite database backend.
KVString double_quote_all_tables_and_columns(const TString &) const
const char * name() const
void primary_key(const TString &cols)
column & add_column(const KVSQLite::column &c)
TString get_table_creation_command() const
bool has_column(const TString &name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
const char * GetName() const override
virtual const char * GetName() const
virtual const char * GetFieldName(Int_t field)=0
virtual TSQLRow * Next()=0
virtual Int_t GetFieldCount()=0
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual char * ExpandPathName(const char *path)