Show view definition
This commit is contained in:
parent
dc949f3c34
commit
ead3ce8a8a
3 changed files with 26 additions and 1 deletions
|
|
@ -68,6 +68,8 @@ QString PgClass::createSql() const
|
|||
if (createSqlCache.isEmpty()) {
|
||||
if (kind == RelKind::Table)
|
||||
createSqlCache = createTableSql();
|
||||
else if (kind == RelKind::View)
|
||||
createSqlCache = createViewSql();
|
||||
|
||||
}
|
||||
return createSqlCache;
|
||||
|
|
@ -159,3 +161,20 @@ QString PgClass::createTableSql() const
|
|||
sql += ";\n";
|
||||
return sql;
|
||||
}
|
||||
|
||||
QString PgClass::createViewSql() const
|
||||
{
|
||||
QString sql;
|
||||
sql += "CREATE OR REPLACE VIEW " + fullyQualifiedQuotedObjectName();
|
||||
|
||||
// todo security_barrier
|
||||
// todo check_option
|
||||
|
||||
sql += " AS \n";
|
||||
sql += viewdef;
|
||||
|
||||
// todo owner
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue