db-explorer
Explore PostgreSQL and DuckDB schemas, tables, and sample data. Use when investigating data issues, checking table structures, or when user asks "DB 구조 알려줘", "데이터 확인해줘".
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
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 등)에 따라 테이블명이 달라질 수 있으므로 먼저 목록을 확인하는 것이 좋습니다.
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!