db-explorer
Explore PostgreSQL and DuckDB schemas, tables, and sample data. Use when investigating data issues, checking table structures, or when user asks "DB 구조 알려줘", "데이터 확인해줘".
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Database Explorer
QueryCraft가 사용하는 하이브리드 데이터베이스 시스템(PostgreSQL + DuckDB)을 탐색합니다.
Instructions
-
스키마 및 테이블 목록 조회:
-
scripts/run_task.py list를 통해 명령어를 확인하거나psql,duckdbCLI를 우회적으로 활용합니다. -
PostgreSQL 테이블 목록:
export PYTHONPATH=$PYTHONPATH:$(pwd) python -c "from backend.engine.postgres_engine import PostgresEngine; from backend.config.db import PostgresEnv; pg=PostgresEngine(PostgresEnv().dsn()); print(pg.fetch_df('SELECT table_name FROM information_schema.tables WHERE table_schema=\'public\''))"
-
-
특정 테이블 스키마 확인:
-
scripts/check_schema.py유틸리티를 사용합니다.python scripts/check_schema.py <table_name>
-
-
샘플 데이터 조회:
- 테이블의 실시간 데이터를 확인할 때 사용합니다.
export PYTHONPATH=$PYTHONPATH:$(pwd) python -c "from backend.engine.postgres_engine import PostgresEngine; from backend.config.db import PostgresEnv; pg=PostgresEngine(PostgresEnv().dsn()); print(pg.fetch_df('SELECT * FROM <table_name> LIMIT 5'))"
- 테이블의 실시간 데이터를 확인할 때 사용합니다.
Key Databases
- PostgreSQL: 사용자 정보, 제출 이력, 정답지(grading 스키마)
-
DuckDB: 대규모 이벤트 로그 (PA 분석용),
data/pa_lab.duckdb
Best Practices
- 쿼리 실행 전 항상
LIMIT을 사용하여 대량 데이터 출력을 방지하세요. - 비즈니스 프로필(commerce, saas 등)에 따라 테이블명이 달라질 수 있으므로 먼저 목록을 확인하는 것이 좋습니다.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!