29 throw std::runtime_error(
"SqliteRecordset::getData : db pointer is null");
32 throw std::runtime_error(
"SqliteRecordset::getData : nodeName is empty");
37 std::ostringstream
sql;
41 sqlite3_stmt* stTable{
nullptr};
42 int rc = sqlite3_prepare_v2(
db,
sql.str().c_str(), -1, &stTable, NULL);
49 sqlite3_stmt* st{
nullptr};
50 rc = sqlite3_prepare_v2(
db,
sql.str().c_str(), -1, &st, NULL);
56 int ctotal = sqlite3_column_count(st);
61 rc = sqlite3_step(st);
63 if(rc == SQLITE_ROW) {
68 for(
int i=0;
i<ctotal; ++
i) {
76 std::string columnName = sqlite3_column_name(st,
i);
77 bool extendDef = (
m_def->find(columnName)==
m_def->end());
79 auto columnType = sqlite3_column_type(st,
i);
86 val = sqlite3_column_int(st,
i);
90 val = sqlite3_column_double(st,
i);
94 val = std::string((
char*)(sqlite3_column_text(st,
i)));
98 val = std::string((
char*)(sqlite3_column_blob(st,
i)));
113 (*m_def)[columnName] = inpType;
119 else if(rc == SQLITE_DONE) {