Rework of catalog objects. Several of them are now inheriting from common
base classes that implement common functionality.
This commit is contained in:
parent
840af1e0a9
commit
73c4cf4790
45 changed files with 340 additions and 265 deletions
40
pglablib/PgNamespaceObject.cpp
Normal file
40
pglablib/PgNamespaceObject.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include "PgNamespaceObject.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include "PgNamespace.h"
|
||||
#include "PgNamespaceContainer.h"
|
||||
#include "SqlFormattingUtils.h"
|
||||
|
||||
PgNamespaceObject::PgNamespaceObject(PgDatabaseCatalog& cat, Oid oid, const QString &name, Oid schema_oid)
|
||||
: PgDatabaseObject(cat, oid, name)
|
||||
, m_schemaOid(schema_oid)
|
||||
{}
|
||||
|
||||
Oid PgNamespaceObject::nsOid() const
|
||||
{
|
||||
return m_schemaOid;
|
||||
}
|
||||
|
||||
//void PgSchemaObject::setSchemaOid(Oid oid)
|
||||
//{
|
||||
// m_schemaOid = oid;
|
||||
//}
|
||||
|
||||
QString PgNamespaceObject::nsName() const
|
||||
{
|
||||
return ns().objectName();
|
||||
}
|
||||
|
||||
QString PgNamespaceObject::quotedNsName() const
|
||||
{
|
||||
return quoteIdent(nsName());
|
||||
}
|
||||
|
||||
QString PgNamespaceObject::fullyQualifiedQuotedObjectName() const
|
||||
{
|
||||
return quotedNsName() + "." + quotedObjectName();
|
||||
}
|
||||
|
||||
const PgNamespace& PgNamespaceObject::ns() const
|
||||
{
|
||||
return *catalog().namespaces()->getByKey(m_schemaOid);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue