From 929109622e7a3a6fa6125048cee531da14d71e2d Mon Sep 17 00:00:00 2001 From: Volker Lieber <42102008+VolkerLieber@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:34:34 +0200 Subject: [PATCH] Include postgres comments in output #391 --- generator/postgres/query_set.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generator/postgres/query_set.go b/generator/postgres/query_set.go index abb21ba..d549cf1 100644 --- a/generator/postgres/query_set.go +++ b/generator/postgres/query_set.go @@ -57,6 +57,7 @@ func getColumnsMetaData(db *sql.DB, schemaName string, tableName string) ([]meta query := ` select attr.attname as "column.Name", + dsc.description as "column.Comment", exists( select 1 from pg_catalog.pg_index indx @@ -81,6 +82,7 @@ from pg_catalog.pg_attribute as attr join pg_catalog.pg_class as cls on cls.oid = attr.attrelid join pg_catalog.pg_namespace as ns on ns.oid = cls.relnamespace join pg_catalog.pg_type as tp on tp.oid = attr.atttypid + left join pg_catalog.pg_description as dsc on dsc.objoid = attr.attrelid and dsc.objsubid = attr.attnum where ns.nspname = $1 and cls.relname = $2 and