mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-29 18:27:43 +08:00
Fix a bug when creating sqlite3 database models (#618)
This commit is contained in:
parent
de37a0ae29
commit
dbf21f7dbc
@ -608,6 +608,10 @@ void create_model::createModelClassFromSqlite3(
|
||||
{
|
||||
info.colType_ = "std::vector<char>";
|
||||
}
|
||||
else if (type == "datetime" || type == "date")
|
||||
{
|
||||
info.colType_ = "::trantor::Date";
|
||||
}
|
||||
else
|
||||
{
|
||||
info.colType_ = "std::string";
|
||||
|
@ -461,10 +461,11 @@ static void loadDbClients(const Json::Value &dbClients)
|
||||
for (auto const &client : dbClients)
|
||||
{
|
||||
auto type = client.get("rdbms", "postgresql").asString();
|
||||
std::transform(type.begin(), type.end(), type.begin(), ::tolower);
|
||||
auto host = client.get("host", "127.0.0.1").asString();
|
||||
auto port = client.get("port", 5432).asUInt();
|
||||
auto dbname = client.get("dbname", "").asString();
|
||||
if (dbname == "")
|
||||
if (dbname == "" && type != "sqlite3")
|
||||
{
|
||||
std::cerr << "Please configure dbname in the configuration file"
|
||||
<< std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user