Support 'password' keyword in configuration files (#343)
* Support 'password' keyword in configuration files * Update travis-ci
This commit is contained in:
parent
ce675c1b87
commit
dd5e8f8159
|
@ -1,7 +1,7 @@
|
|||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: bionic
|
||||
dist: xenial
|
||||
- os: osx
|
||||
osx_image: xcode11
|
||||
|
||||
|
@ -48,6 +48,7 @@ before_install:
|
|||
- cd -
|
||||
before_script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
brew tap homebrew/services;
|
||||
brew services restart postgresql;
|
||||
sleep 2;
|
||||
psql -c 'create user postgres superuser;' postgres;
|
||||
|
|
|
@ -704,6 +704,10 @@ void create_model::createModel(const std::string &path,
|
|||
exit(1);
|
||||
}
|
||||
auto password = config.get("passwd", "").asString();
|
||||
if (password.empty())
|
||||
{
|
||||
password = config.get("password", "").asString();
|
||||
}
|
||||
|
||||
auto connStr =
|
||||
utils::formattedString("host=%s port=%u dbname=%s user=%s",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"schema": "public",
|
||||
//user: User name
|
||||
"user": "",
|
||||
//password: Password
|
||||
//passwd: Password
|
||||
"passwd": "",
|
||||
//table: An array of tables to be modelized. if the array is empty, all revealed tables are modelized.
|
||||
"tables": [],
|
||||
|
|
|
@ -421,6 +421,10 @@ static void loadDbClients(const Json::Value &dbClients)
|
|||
}
|
||||
auto user = client.get("user", "postgres").asString();
|
||||
auto password = client.get("passwd", "").asString();
|
||||
if (password.empty())
|
||||
{
|
||||
password = client.get("password", "").asString();
|
||||
}
|
||||
auto connNum = client.get("connection_number", 1).asUInt();
|
||||
auto name = client.get("name", "default").asString();
|
||||
auto filename = client.get("filename", "").asString();
|
||||
|
|
Loading…
Reference in New Issue