Bezig met crudmodel/tab
This commit is contained in:
parent
ee321b3fb1
commit
14ab400ccb
15 changed files with 308 additions and 33 deletions
31
pglab/CrudModel.cpp
Normal file
31
pglab/CrudModel.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "CrudModel.h"
|
||||
#include "OpenDatabase.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include "PgAttributeContainer.h"
|
||||
#include "PgConstraintContainer.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
CrudModel::CrudModel()
|
||||
: m_dbConn(*getGlobalAsioIoService())
|
||||
{}
|
||||
|
||||
CrudModel::~CrudModel()
|
||||
{
|
||||
m_dbConn.closeConnection();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Strategy
|
||||
* when ordered by primary key, offset and limit work very quickly so we can get away with not loading
|
||||
* everything.
|
||||
*/
|
||||
void CrudModel::setData(std::shared_ptr<OpenDatabase> db, const PgClass &table)
|
||||
{
|
||||
m_database = db;
|
||||
m_table = table;
|
||||
m_primaryKey = db->catalogue()->constraints()->getPrimaryForRelation(table.oid);
|
||||
//cat->attributes()->getColumnsForRelation()
|
||||
m_dbConn.setupConnection(m_database.config());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue