New column page

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)
This commit is contained in:
eelke 2018-11-29 20:21:36 +01:00
parent 73c4cf4790
commit 57217974f4
19 changed files with 345 additions and 55 deletions

View file

@ -0,0 +1,28 @@
#include "PgCollationContainer.h"
#include "Pgsql_Connection.h"
#include "Pgsql_Col.h"
#include "PgDatabaseCatalog.h"
#include <iterator>
std::string PgCollationContainer::getLoadQuery() const
{
return "SELECT oid, collname, collnamespace, collowner, collencoding, \n"
" collcollate, collctype \n"
"FROM pg_collation";
}
PgCollation PgCollationContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
Oid class_oid = col.nextValue();
QString name = col.nextValue();
Oid ns_oid = col.nextValue();
PgCollation v(m_catalog, class_oid, name, ns_oid);
Oid owner ;
col >> owner >> v.collencoding >> v.collcollate >> v.collctype;
v.setOwnerOid(m_catalog, owner);
return v;
}