WIP createdb dialog
This commit is contained in:
parent
c20427e10d
commit
d3080a08bb
10 changed files with 113 additions and 45 deletions
|
|
@ -1,9 +1,12 @@
|
|||
#include "CreateDatabaseDialog.h"
|
||||
#include "ui_CreateDatabaseDialog.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
CreateDatabaseDialog::CreateDatabaseDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CreateDatabaseDialog)
|
||||
CreateDatabaseDialog::CreateDatabaseDialog(std::shared_ptr<PgDatabaseCatalog> catalog, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::CreateDatabaseDialog)
|
||||
, m_catalog(catalog)
|
||||
, definition(*catalog, InvalidOid, "")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
|
@ -23,3 +26,29 @@ CreateDatabaseDialog::~CreateDatabaseDialog()
|
|||
// [ ALLOW_CONNECTIONS [=] allowconn ]
|
||||
// [ CONNECTION LIMIT [=] connlimit ]
|
||||
// [ IS_TEMPLATE [=] istemplate ] ]
|
||||
|
||||
void CreateDatabaseDialog::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
if (index == 0)
|
||||
return;
|
||||
|
||||
// update the sql
|
||||
definition.setObjectName(ui->name->text());
|
||||
|
||||
// definition.setOwnerOid()
|
||||
definition.dbTemplate = ui->dbTemplate->currentText();
|
||||
|
||||
//QString drop_sql = definition.dropSql();
|
||||
QString create_sql = definition.createSql();
|
||||
ui->sqlPreview->setPlainText(create_sql);
|
||||
|
||||
// create_sql += "\n\n-- set Privileges\n";
|
||||
// create_sql += definition.grantSql() % "\n";
|
||||
|
||||
// create_sql += "-- set comment\n";
|
||||
// create_sql += definition.commentSql() % "\n";
|
||||
|
||||
// ui->sqlPreview->setPlainText(drop_sql % "\n\n" % create_sql);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue