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
|
|
@ -5,16 +5,11 @@
|
|||
#include "SqlFormattingUtils.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
QString PgTrigger::objectName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
QString PgTrigger::dropSql()
|
||||
{
|
||||
if (m_dropSql.isEmpty()) {
|
||||
auto&& fqtablename = genFQTableName(catalog(), *catalog().classes()->getByKey(relid));
|
||||
m_dropSql = "DROP TRIGGER " % quoteIdent(name)
|
||||
auto&& fqtablename = catalog().classes()->getByKey(relid)->fullyQualifiedQuotedObjectName(); // genFQTableName(catalog(), *catalog().classes()->getByKey(relid));
|
||||
m_dropSql = "DROP TRIGGER " % quotedObjectName()
|
||||
% " ON " % fqtablename % ";";
|
||||
}
|
||||
return m_dropSql;
|
||||
|
|
@ -23,8 +18,8 @@ QString PgTrigger::dropSql()
|
|||
QString PgTrigger::createSql()
|
||||
{
|
||||
if (m_createSql.isEmpty()) {
|
||||
auto&& fqtablename = genFQTableName(catalog(), *catalog().classes()->getByKey(relid));
|
||||
auto&& triggername = quoteIdent(name);
|
||||
auto&& fqtablename = catalog().classes()->getByKey(relid)->fullyQualifiedQuotedObjectName(); //genFQTableName(catalog(), *catalog().classes()->getByKey(relid));
|
||||
auto&& triggername = quotedObjectName();
|
||||
|
||||
if (constraint != InvalidOid)
|
||||
m_createSql += "CREATE CONSTRAINT TRIGGER ";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue