You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Database/Drivers/PgSqlDriver.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -113,10 +113,12 @@ public function getTables(): array
113
113
SELECT DISTINCT ON (c.relname)
114
114
c.relname::varchar AS name,
115
115
c.relkind IN ('v', 'm') AS view,
116
-
n.nspname::varchar || '.' || c.relname::varchar AS "fullName"
116
+
n.nspname::varchar || '.' || c.relname::varchar AS "fullName",
117
+
coalesce(d.description, '') AS comment
117
118
FROM
118
119
pg_catalog.pg_class AS c
119
120
JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
121
+
LEFT JOIN pg_catalog.pg_description d ON d.objoid = c.oid AND d.objsubid = 0
120
122
WHERE
121
123
c.relkind IN ('r', 'v', 'm', 'p')
122
124
AND n.nspname = ANY (pg_catalog.current_schemas(FALSE))
@@ -150,6 +152,7 @@ public function getColumns(string $table): array
150
152
pg_catalog.pg_get_expr(ad.adbin, 'pg_catalog.pg_attrdef'::regclass)::varchar AS default,
151
153
coalesce(co.contype = 'p' AND (seq.relname IS NOT NULL OR strpos(pg_catalog.pg_get_expr(ad.adbin, ad.adrelid), 'nextval') = 1), FALSE) AS autoincrement,
152
154
coalesce(co.contype = 'p', FALSE) AS primary,
155
+
coalesce(col_description(c.oid, a.attnum)::varchar, '') AS comment,
153
156
coalesce(seq.relname, substring(pg_catalog.pg_get_expr(ad.adbin, 'pg_catalog.pg_attrdef'::regclass) from 'nextval[(]''"?([^''"]+)')) AS sequence
0 commit comments