|
| 1 | +export namespace Roles { |
| 2 | + export interface Role { |
| 3 | + name: string |
| 4 | + id: number |
| 5 | + has_create_db_privileges: boolean |
| 6 | + is_super_user: boolean |
| 7 | + has_replication_privileges: boolean |
| 8 | + can_bypass_rls: boolean |
| 9 | + valid_until: string | null |
| 10 | + user_config: string | null |
| 11 | + connections: number |
| 12 | + max_user_connections: number |
| 13 | + max_db_connections: number |
| 14 | + grants: Grant[] |
| 15 | + } |
| 16 | + |
| 17 | + export interface Grant { |
| 18 | + table_id: string |
| 19 | + grantor: string |
| 20 | + grantee: string |
| 21 | + catalog: string |
| 22 | + schema: string |
| 23 | + table_name: string |
| 24 | + privilege_type: string |
| 25 | + is_grantable: boolean |
| 26 | + with_hierarchy: boolean |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +export namespace Schemas { |
| 31 | + export interface Schema { |
| 32 | + catalog_name: string |
| 33 | + name: string |
| 34 | + owner: string |
| 35 | + default_character_set_catalog: string | null |
| 36 | + default_character_set_schema: string | null |
| 37 | + default_character_set_name: string | null |
| 38 | + sql_path: string | null |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +export namespace Tables { |
| 43 | + export interface Table { |
| 44 | + table_id: string |
| 45 | + catalog: string |
| 46 | + schema: string |
| 47 | + name: string |
| 48 | + is_insertable_into: boolean |
| 49 | + is_typed: boolean |
| 50 | + bytes: number |
| 51 | + size: string |
| 52 | + |
| 53 | + // pg_stat_all_tables columns |
| 54 | + sequential_scans: number |
| 55 | + sequential_scan_row_reads: number |
| 56 | + index_scans: number |
| 57 | + index_scan_row_reads: number |
| 58 | + row_inserts: number |
| 59 | + row_updates: number |
| 60 | + row_deletes: number |
| 61 | + row_hot_updates: number |
| 62 | + live_rows: number |
| 63 | + dead_rows: number |
| 64 | + rows_modified_since_analyze: number |
| 65 | + last_vacuum: string | null |
| 66 | + last_autovacuum: string | null |
| 67 | + last_analyze: string | null |
| 68 | + last_autoanalyze: string | null |
| 69 | + vacuum_count: number |
| 70 | + autovacuum_count: number |
| 71 | + analyze_count: number |
| 72 | + autoanalyze_count: number |
| 73 | + |
| 74 | + columns: Column[] |
| 75 | + grants: Roles.Grant[] |
| 76 | + primary_keys: PrimaryKey[] |
| 77 | + relationships: Relationship[] |
| 78 | + } |
| 79 | + |
| 80 | + export interface Column { |
| 81 | + schema: string |
| 82 | + table: string |
| 83 | + name: string |
| 84 | + default_value: string | null |
| 85 | + is_identity: boolean |
| 86 | + is_nullable: boolean |
| 87 | + is_updatable: boolean |
| 88 | + data_type: string |
| 89 | + format: string |
| 90 | + identity_generation: string | null |
| 91 | + table_id: string |
| 92 | + description: string | null |
| 93 | + enums: string[] |
| 94 | + } |
| 95 | + |
| 96 | + export interface PrimaryKey { |
| 97 | + schema: string |
| 98 | + table_name: string |
| 99 | + name: string |
| 100 | + table_id: string |
| 101 | + } |
| 102 | + |
| 103 | + export interface Relationship { |
| 104 | + source_table_id: string |
| 105 | + source_schema: string |
| 106 | + source_table_name: string |
| 107 | + source_column_name: string |
| 108 | + target_table_id: string |
| 109 | + target_table_schema: string |
| 110 | + target_table_name: string |
| 111 | + target_column_name: string |
| 112 | + constraint_name: string |
| 113 | + } |
| 114 | +} |
| 115 | + |
| 116 | +export namespace Types { |
| 117 | + export interface Type { |
| 118 | + type_id: string |
| 119 | + name: string |
| 120 | + schema: string |
| 121 | + format: string |
| 122 | + description: string | null |
| 123 | + enums: string[] |
| 124 | + } |
| 125 | +} |
0 commit comments