materialized-views.ts15 lines · main
| 1 | import { safeSql } from '../pg-format' |
| 2 | |
| 3 | export const MATERIALIZED_VIEWS_SQL = /* SQL */ safeSql` |
| 4 | select |
| 5 | c.oid::int8 as id, |
| 6 | n.nspname as schema, |
| 7 | c.relname as name, |
| 8 | c.relispopulated as is_populated, |
| 9 | obj_description(c.oid) as comment |
| 10 | from |
| 11 | pg_class c |
| 12 | join pg_namespace n on n.oid = c.relnamespace |
| 13 | where |
| 14 | c.relkind = 'm' |
| 15 | ` |