2929### Layout Structure
3030
3131** Header**
32+
3233- Application title: "LLM SQL Analytics"
3334- Navigation: Dashboard, Query Interface, Schema Docs, Settings
3435
3536** Main Content Area**
37+
3638- Dashboard: Overview of connected databases and recent queries
3739- Query Interface: Natural language input + SQL preview + results table
3840- Schema Docs: List of uploaded documents with semantic search
3941- Settings: Database connection configuration
4042
4143** Footer**
44+
4245- Version info and copyright
4346
4447### Visual Design
4548
4649** Color Palette**
50+
4751- Primary: ` #1E3A5F ` (Deep Navy)
4852- Secondary: ` #3D5A80 ` (Slate Blue)
4953- Accent: ` #48CAE4 ` (Cyan)
5660- Warning: ` #FFC107 ` (Yellow)
5761
5862** Typography**
63+
5964- Headings: "Inter", sans-serif, 600 weight
6065- Body: "Inter", sans-serif, 400 weight
6166- Monospace (SQL): "JetBrains Mono", monospace
6267
6368** Spacing**
69+
6470- Base unit: 8px
6571- Container max-width: 1200px
6672- Card padding: 24px
6975### Components
7076
7177** Query Input Card**
78+
7279- Textarea for natural language input
7380- "Generate SQL" button (primary style)
7481- "Execute" button (accent style)
7582- SQL preview panel with syntax highlighting
7683
7784** Results Table**
85+
7886- Sortable columns
7987- Pagination for large results
8088- Export to CSV option
8189
8290** Schema Doc Card**
91+
8392- Document name
8493- Upload date
8594- Preview snippet
8695- Semantic search input
8796
8897** Database Connection Card**
98+
8999- Connection name
90100- Database type indicator
91101- Status indicator (connected/disconnected)
98108### Core Features
99109
100110#### 4.1 Database Connection Management
111+
101112- Add PostgreSQL database connections with connection details
102113- Test database connectivity
103114- Store connection configurations securely
104115- Support multiple database connections
105116
106117#### 4.2 Schema Introspection
118+
107119- Automatically fetch table names and column information
108120- Store schema in PostgreSQL with pgvector for semantic search
109121- Support uploading schema documentation (PDF)
110122
111123#### 4.3 Natural Language to SQL
124+
112125- Accept natural language queries
113126- Use LLM to convert natural language to SQL
114127- Support SELECT, INSERT, UPDATE, DELETE operations
115128- Include validation and error handling
116129
117130#### 4.4 Semantic Schema Search
131+
118132- Embed schema documentation using sentence-transformers
119133- Store embeddings in pgvector
120134- Search schema semantically to find relevant tables/columns
121135
122136#### 4.5 Query Execution
137+
123138- Execute generated SQL against target database
124139- Return formatted results
125140- Handle errors gracefully with user-friendly messages
126141
127142#### 4.6 Query History
143+
128144- Store all queries with timestamps
129145- View past queries and their results
130146- Re-run previous queries
@@ -192,20 +208,20 @@ QueryHistory
192208
193209## 6. API Endpoints
194210
195- | Method | Endpoint | Description |
196- | -------- | ----------| -------------|
197- | GET | /api/connections/ | List all database connections |
198- | POST | /api/connections/ | Add new database connection |
199- | GET | /api/connections/{id}/ | Get connection details |
200- | PUT | /api/connections/{id}/ | Update connection |
201- | DELETE | /api/connections/{id}/ | Delete connection |
202- | POST | /api/connections/{id}/test/ | Test connection |
203- | GET | /api/connections/{id}/schema/ | Get database schema |
204- | POST | /api/query/ | Execute natural language query |
205- | GET | /api/history/ | Get query history |
206- | POST | /api/docs/ | Upload schema document |
207- | GET | /api/docs/ | List schema documents |
208- | POST | /api/docs/search/ | Semantic search in documents |
211+ | Method | Endpoint | Description |
212+ | ------ | -- --------------------------- | ------------------------------ |
213+ | GET | /api/connections/ | List all database connections |
214+ | POST | /api/connections/ | Add new database connection |
215+ | GET | /api/connections/{id}/ | Get connection details |
216+ | PUT | /api/connections/{id}/ | Update connection |
217+ | DELETE | /api/connections/{id}/ | Delete connection |
218+ | POST | /api/connections/{id}/test/ | Test connection |
219+ | GET | /api/connections/{id}/schema/ | Get database schema |
220+ | POST | /api/query/ | Execute natural language query |
221+ | GET | /api/history/ | Get query history |
222+ | POST | /api/docs/ | Upload schema document |
223+ | GET | /api/docs/ | List schema documents |
224+ | POST | /api/docs/search/ | Semantic search in documents |
209225
210226---
211227
@@ -220,4 +236,4 @@ QueryHistory
2202367 . ✓ System performs semantic search over schema docs
2212378 . ✓ Query history is maintained
2222389 . ✓ Web interface is responsive and functional
223- 10 . ✓ Error handling provides helpful feedback
239+ 10 . ✓ Error handling provides helpful feedback
0 commit comments