Flexible models

This commit is contained in:
Eelke Klein 2018-09-02 10:30:30 +00:00
parent 50cb21b6f9
commit 8b7bbec807
24 changed files with 333 additions and 51 deletions

View file

@ -0,0 +1,25 @@
#include "PgTablespaceContainer.h"
#include "Pgsql_Connection.h"
#include "Pgsql_Col.h"
#include "Pgsql_declare.h"
#include "PgDatabaseCatalog.h"
#include <iterator>
std::string PgTablespaceContainer::getLoadQuery() const
{
return
R"__SQL__(
SELECT oid, spcname, spcowner, spcacl, spcoptions
FROM pg_tablespace
)__SQL__";
}
PgTablespace PgTablespaceContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgTablespace v;
col >> v.oid >> v.name >> v.owner;
col.getAsArray<QString>(std::back_inserter(v.acl), Pgsql::NullHandling::Ignore);
col.getAsArray<QString>(std::back_inserter(v.options), Pgsql::NullHandling::Ignore);
return v;
}