Generate COMMENT IS statements for columns

This commit is contained in:
eelke 2021-07-02 20:42:32 +02:00
parent 5777a9c834
commit 45795333f2
3 changed files with 16 additions and 3 deletions

View file

@ -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) % ";";
}