Basic support for passing postgresql uri on the commandline

This commit is contained in:
eelke 2025-02-17 18:09:19 +01:00
parent 4b4c95e57e
commit 4caccf1000
11 changed files with 453 additions and 192 deletions

View file

@ -1,5 +1,8 @@
#include "MasterController.h"
#include "ConnectionController.h"
#include "utils/PostgresqlUrlParser.h"
#include <ConnectionConfig.h>
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QStandardPaths>
@ -38,7 +41,20 @@ void MasterController::init()
}
m_connectionController = new ConnectionController(this);
m_connectionController->init();
m_connectionController->init();
QStringList arguments = QCoreApplication::arguments();
for (auto && arg : arguments)
{
ConnectionConfig cfg;
if (TryParsePostgresqlUrl(arg, cfg)) {
m_connectionController->openSqlWindowForConnection(cfg);
return;
}
}
m_connectionController->showConnectionManager();
}
ConnectionController *MasterController::connectionController()