Shows SQL for columns ALTER TABLE ... [ADD|DROP] COLUMN combines a selection of multiple columns into a single alter table. Show collation in list of columns. (order of columns isn't what is should be but that should maybe be fixed by a generic column selection and ordering mechanism that knows what the default sort should be)
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
#ifndef TABLESPAGE_H
|
|
#define TABLESPAGE_H
|
|
|
|
#include <QWidget>
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <QItemSelection>
|
|
|
|
namespace Ui {
|
|
class TablesPage;
|
|
}
|
|
|
|
class TablesTableModel;
|
|
class ColumnPage;
|
|
class ColumnTableModel;
|
|
class ConstraintModel;
|
|
class PgDatabaseCatalog;
|
|
class NamespaceFilterWidget;
|
|
class IndexModel;
|
|
class MainWindow;
|
|
class PropertiesPage;
|
|
class TriggerPage;
|
|
class PgClass;
|
|
|
|
class TablesPage : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TablesPage(MainWindow *parent = nullptr);
|
|
~TablesPage();
|
|
|
|
void setCatalog(std::shared_ptr<PgDatabaseCatalog> cat);
|
|
private:
|
|
Ui::TablesPage *ui;
|
|
MainWindow *m_window;
|
|
// QWidget *m_columnsTab;
|
|
ColumnPage *m_columnsPage;
|
|
// QWidget *m_propertiesTab;
|
|
PropertiesPage *m_propertiesPage;
|
|
// QWidget *m_triggerTab;
|
|
TriggerPage *m_triggerPage;
|
|
std::shared_ptr<PgDatabaseCatalog> m_catalog;
|
|
TablesTableModel* m_tablesModel = nullptr;
|
|
ColumnTableModel* m_columnsModel = nullptr;
|
|
ConstraintModel* m_constraintModel = nullptr;
|
|
IndexModel* m_indexModel = nullptr;
|
|
//NamespaceFilterWidget* m_namespaceFilterWidget;
|
|
|
|
void retranslateUi(bool all = true);
|
|
// QWidget* addDetailTab(QWidget *contents, bool infront = false);
|
|
|
|
void selectedTableChanged(const std::optional<PgClass> &table);
|
|
private slots:
|
|
|
|
void tableListTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
void tableListTable_layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
|
|
// void constraintsTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
void constraintsTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
|
void constraintsTable_modelReset();
|
|
void indexesTable_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
|
void indexesTable_modelReset();
|
|
void on_tableListTable_doubleClicked(const QModelIndex &index);
|
|
};
|
|
|
|
#endif // TABLESPAGE_H
|