entity query and record progress
This commit is contained in:
@@ -65,7 +65,7 @@ int sqlite_connection::parse_result(void* param, int column_count, char** values
|
||||
|
||||
if (context->prototype.empty()) {
|
||||
for(int i = 0; i < column_count; ++i) {
|
||||
context->prototype.append(sql::column_definition{columns[i]});
|
||||
context->prototype.emplace_back(columns[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,12 +144,12 @@ sql::data_type_t string2type(const char *type)
|
||||
}
|
||||
}
|
||||
|
||||
sql::record sqlite_connection::describe(const std::string& table)
|
||||
std::vector<sql::column_definition> sqlite_connection::describe(const std::string& table)
|
||||
{
|
||||
const auto result = fetch_internal("PRAGMA table_info(" + table + ")");
|
||||
|
||||
sqlite_result_reader reader(result.rows, result.prototype.size());
|
||||
sql::record prototype;
|
||||
std::vector<sql::column_definition> prototype;
|
||||
while (reader.fetch()) {
|
||||
char *end = nullptr;
|
||||
// Todo: add index to column
|
||||
@@ -163,7 +163,7 @@ sql::record sqlite_connection::describe(const std::string& table)
|
||||
null_opt = sql::null_option::NOT_NULL;
|
||||
}
|
||||
// f.default_value(res->column(4));
|
||||
prototype.append({name, type, utils::null_attributes, null_opt, index});
|
||||
prototype.emplace_back(name, type, utils::null_attributes, null_opt, index);
|
||||
}
|
||||
|
||||
return std::move(prototype);
|
||||
|
||||
Reference in New Issue
Block a user