views.ts15 lines · main
| 1 | import { safeSql } from '../pg-format' |
| 2 | |
| 3 | export const VIEWS_SQL = /* SQL */ safeSql` |
| 4 | SELECT |
| 5 | c.oid :: int8 AS id, |
| 6 | n.nspname AS schema, |
| 7 | c.relname AS name, |
| 8 | (pg_relation_is_updatable(c.oid, false) & 20) = 20 AS is_updatable, |
| 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 = 'v' |
| 15 | ` |