HN 표시: SchemaSight – Ollama를 사용하여 로컬로 데이터베이스 스키마와 채팅

hackernews | | 🔬 연구
#llama #ollama #review #schemasight #vs code #데이터베이스 #로컬 ai
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

직장에서 레거시 데이터베이스의 복잡한 비즈니스 로직을 파악하는 데 어려움을 겪어 개발한 도구 'SchemaSight'가 공개되었습니다. 이 도구는 VS Code 내에서 로컬 LLM을 활용해 SQL Server, PostgreSQL, MySQL 스키마를 분석하고, 자연어로 데이터베이스 구조에 대해 질문하고 답변을 얻을 수 있게 합니다. 모든 과정이 사용자의 로컬 머신에서 실행되어 클라우드나 API 키 없이 데이터가 유출되지 않는 보안성을 갖춘 것이 특징입니다.

본문

Chat with your database. Locally. Understand any database, instantly — local AI, no cloud, no data leaves your machine. SchemaSight is a VS Code extension for developers who need to make sense of unfamiliar or legacy databases. Connect to SQL Server, PostgreSQL, or MySQL, index schema objects locally, and ask grounded questions about tables, views, stored procedures, functions, and business logic without leaving your editor. Developers lose hours reading database schemas, stored procedures, and scattered business logic just to answer questions like: - What does this procedure do? - Where is row-level security applied? - What tables are involved in invoicing? - What is this database about? SchemaSight helps you answer those questions from the indexed schema itself, with local retrieval and local LLM generation. - A local-first database comprehension copilot for VS Code - Built for schema exploration and stored-code understanding - Best for onboarding, maintenance, audits, and legacy-database discovery - Not a live SQL execution tool - Not a row-level data exploration or BI tool - Not a database performance tuning or query-plan analyzer - SQL Server - PostgreSQL - MySQL - Add and manage database connections in the VS Code sidebar - Guided onboarding flow with Ollama verification, model pull, and schema crawl in one place - Change your chat model at any time via the model settings panel — pull and re-index without leaving VS Code - Crawl and index tables, views, stored procedures, and functions - Use local embeddings and local Ollama models for grounded Q&A - Ask follow-up questions like “can you explain it?” with object resolution - Inspect how answers were produced through context and retrieval visibility - View index status and quality details for each connection SchemaSight is designed for teams that cannot or do not want schema understanding workflows to depend on a cloud service. - Retrieval and answer generation run on your machine via Ollama - Embeddings run locally via Transformers.js (all-MiniLM-L6-v2) — no external embedding API required - Credentials are stored using VS Code secret storage - The extension works from schema metadata and object definitions, not uploaded app code - Install and start Ollama. - Open SchemaSight from the VS Code sidebar or run SchemaSight: Open Panel . - Add a database connection. - Follow the onboarding flow — verify Ollama, pull your model, and crawl the schema all from within the extension. Note: Initial indexing summarizes every schema object using a local LLM. On an Apple M5 16GB with ~95 objects, this takes approximately 15–20 minutes. Older hardware will take longer. This is a one-time cost — re-indexing is only needed when your schema changes or you switch models. - Ask questions in plain English about your schema, tables, stored procedures, and business logic. - What is this database about? - What tables are related to orders? - Is there logic to remove row-level security? - Explain example_store_procedure in detail. - What does this stored procedure update? SchemaSight uses a layered architecture with clear separation of concerns: | Layer | Role | Key components | Location | |---|---|---|---| | Presentation | React webview UI; sends and receives typed messages over the VS Code postMessage bridge | App, Sidebar, ChatPanel, useConnections / useChat / useOllamaStatus, vscodeApi | src/webview/ (App, components, hooks) | | Adapter | Message routing and request handling; dispatches webview messages to handlers | PanelManager, MessageRouter, ConnectionHandler, CrawlHandler, ChatHandler, IndexHandler, OllamaHandler | src/webview/MessageRouter.ts , src/webview/handlers/ | | Domain services | Business logic: RAG pipeline (retrieval, context, summarization), indexing pipeline | RagPipelineService, Indexer | src/services/rag/ , src/services/indexing/ | | Repositories | Data access and external APIs | ConnectionRepository, SchemaRepository, ChunkRepository, OllamaRepository, EmbeddingRepository | src/repositories/ | | Infrastructure | DB drivers, prompt building, shared types | PromptBuilder, DB drivers (Mssql, Postgres, Mysql) | src/db/drivers/ , src/llm/ , src/shared/ | The extension host uses dependency injection: extension.ts constructs repositories and services and passes a single Services object into PanelManager and then MessageRouter . Handlers receive only the repositories and services they need. The webview and extension communicate via a message-based API defined in shared/types.ts (no shared runtime beyond postMessage). User actions go from the webview over postMessage into the extension host, then down through handlers → services → repositories to external systems. The table above lists the components in each layer. The frontend is a single React app mounted in the panel and sidebar webview. App.tsx coordinates three main hooks: - useConnections() — Connection list, add/remove/test, crawl status, crawled-connection ids, index stats - useChat() — Per-connection

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →