/
foult080
/
terminal-db
Обзор
Документация
Войти
/
foult080
/
terminal-db
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/db/schema/PostgresSchemaExplorerAdapter.ts
25 строк
734 B
foult080
feat(): add mongodb usage
13 июл 2026, 07:49
13 июл 2026, 07:49
e2440af
Код
Авторство
О чём код?
import type { ISchemaExplorer, SchemaItem } from "../types.js" import type { SchemaExplorer } from "./SchemaExplorer.js" export class PostgresSchemaExplorerAdapter implements ISchemaExplorer { constructor(private explorer: SchemaExplorer) {} async getItems(connectionId: string): Promise<SchemaItem[]> { const schemas = await this.explorer.getSchemas(connectionId) const items: SchemaItem[] = [] for (const schema of schemas) { const tables = await this.explorer.getTables(connectionId, schema.name) items.push({ name: schema.name, type: "schema", children: tables.map((t) => ({ name: t.name, type: t.type, })), }) } return items } }