()
| 28 | } |
| 29 | |
| 30 | public async getChildren(): Promise<INode[]> { |
| 31 | const connection = await Database.createConnection(this.connection); |
| 32 | |
| 33 | try { |
| 34 | const res = await connection.query(` |
| 35 | SELECT nspname as name |
| 36 | FROM pg_namespace |
| 37 | WHERE |
| 38 | nspname not in ('information_schema', 'pg_catalog', 'pg_toast') |
| 39 | AND nspname not like 'pg_temp_%' |
| 40 | AND nspname not like 'pg_toast_temp_%' |
| 41 | AND has_schema_privilege(oid, 'CREATE, USAGE') |
| 42 | ORDER BY nspname;`); |
| 43 | |
| 44 | return res.rows.map<SchemaNode>(schema => { |
| 45 | return new SchemaNode(this.connection, schema.name); |
| 46 | }) |
| 47 | } catch(err) { |
| 48 | return [new InfoNode(err)]; |
| 49 | } finally { |
| 50 | await connection.end(); |
| 51 | } |
| 52 | } |
| 53 | } |
nothing calls this directly
no test coverage detected