Generate COMMENT IS statements for columns
This commit is contained in:
parent
5777a9c834
commit
45795333f2
3 changed files with 16 additions and 3 deletions
|
|
@ -63,4 +63,11 @@ QString PgAttribute::alterTableDropColumn(const PgDatabaseCatalog &cat, const Pg
|
|||
return sql;
|
||||
}
|
||||
|
||||
QString PgAttribute::commentStatement(const PgDatabaseCatalog &cat, const PgClass &table) const
|
||||
{
|
||||
if (description.isEmpty())
|
||||
return {};
|
||||
|
||||
return "COMMENT ON COLUMN " % table.fullyQualifiedQuotedObjectName() % "."
|
||||
% quoteIdent(name) % " IS " % escapeLiteral(description) % ";";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public:
|
|||
QString columnDefinition(const PgDatabaseCatalog &cat) const;
|
||||
QString alterTableAddColumn(const PgDatabaseCatalog &cat, const PgClass &table) const;
|
||||
QString alterTableDropColumn(const PgDatabaseCatalog &cat, const PgClass &table) const;
|
||||
QString commentStatement(const PgDatabaseCatalog &cat, const PgClass &table) const;
|
||||
|
||||
bool isSerial() const { return !sername.isEmpty(); }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue