# db_query **Repository Path**: dkgee/db_query ## Basic Information - **Project Name**: db_query - **Description**: ai培训实例 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-05 - **Last Updated**: 2026-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Database Query Tool A web-based tool for managing PostgreSQL database connections, viewing metadata, and executing SQL queries with natural language support. ## Project Structure ``` w2/db_query/ ├── backend/ # FastAPI backend (Python 3.12+) ├── frontend/ # React frontend (TypeScript, Refine 5) ├── fixtures/ # REST Client test files │ ├── test.rest # API test requests │ └── README.md # Testing guide └── Makefile # Development commands ``` ## Quick Start ### Initial Setup ```bash # Install all dependencies make install # Setup database and environment make setup # Then edit backend/.env and add your OPENAI_API_KEY # Start development servers make dev ``` ### Development Commands ```bash # View all available commands make help # Start backend only make dev-backend # Start frontend only make dev-frontend # Run tests make test # Format code make format # Run linters make lint ``` ## API Testing ### Using REST Client (VSCode) 1. Install [REST Client extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) 2. Open `fixtures/test.rest` 3. Click "Send Request" above any HTTP request 4. View responses in VSCode panel See `fixtures/README.md` for detailed testing guide. ### Using Makefile ```bash # Check if backend is running make health # Open API documentation make docs ``` ## Phase 1 Status ✅ **Phase 1 Complete**: All setup and foundation tasks completed. - Backend project structure initialized - Frontend project structure initialized - Core infrastructure (FastAPI, database, models) ready - Data models defined with camelCase API convention - Makefile with common development tasks - REST Client test file for API testing ## Next Steps Proceed to Phase 2 for core feature implementation (US1 + US2).