Move project files from uzdb/ subdirectory to root directory for cleaner project structure.
Changes:
- Move frontend/ to root
- Move internal/ to root
- Move build/ to root
- Move all config files (go.mod, wails.json, etc.) to root
- Remove redundant uzdb/ subdirectory nesting
Project structure is now:
├── frontend/ # React application
├── internal/ # Go backend
├── build/ # Wails build assets
├── doc/ # Design documentation
├── main.go # Entry point
└── ...
🤖 Generated with Qoder
3.0 KiB
3.0 KiB
API Testing Guide
Base URL
Development: http://localhost:8080/api
Connection Management
List all connections
curl http://localhost:8080/api/connections
Create a new connection
curl -X POST http://localhost:8080/api/connections \
-H "Content-Type: application/json" \
-d '{
"name": "My Database",
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "password123",
"database": "mydb"
}'
Update a connection
curl -X PUT http://localhost:8080/api/connections/{id} \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Name",
"host": "new-host.com"
}'
Delete a connection
curl -X DELETE http://localhost:8080/api/connections/{id}
Test connection
curl -X POST http://localhost:8080/api/connections/{id}/test
Query Operations
Execute a query
curl -X POST http://localhost:8080/api/query \
-H "Content-Type: application/json" \
-d '{
"connectionId": "{connection-id}",
"sql": "SELECT * FROM users LIMIT 10"
}'
Get tables from a connection
curl http://localhost:8080/api/connections/{id}/tables
Get table data
curl "http://localhost:8080/api/connections/{id}/tables/users/data?limit=20&offset=0"
Get table structure
curl http://localhost:8080/api/connections/{id}/tables/users/structure
Saved Queries
List saved queries
curl http://localhost:8080/api/saved-queries
Save a query
curl -X POST http://localhost:8080/api/saved-queries \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Users Report",
"sql": "SELECT * FROM users WHERE created_at > NOW() - INTERVAL 1 DAY",
"connectionId": "{connection-id}"
}'
Execute saved query
curl -X POST http://localhost:8080/api/saved-queries/{id}/execute
Query History
Get query history
curl http://localhost:8080/api/history?limit=50
Clear query history
curl -X DELETE http://localhost:8080/api/history
Response Format
All responses follow this format:
Success
{
"success": true,
"data": { ... },
"message": ""
}
Error
{
"success": false,
"data": null,
"error": "Error message here",
"code": "CONNECTION_NOT_FOUND"
}
Using Wails Bindings (from Frontend)
// Import Wails runtime
import { Events } from "@wailsio/runtime";
// Get all connections
const connections = await window.go.app.GetConnections();
// Create connection
await window.go.app.CreateConnection({
name: "Test DB",
type: "mysql",
host: "localhost",
port: 3306,
username: "root",
password: "secret",
database: "test"
});
// Execute query
const result = await window.go.app.ExecuteQuery(
connectionId,
"SELECT * FROM users"
);
console.log("Rows:", result.rows);
console.log("Columns:", result.columns);
console.log("Execution time:", result.executionTimeMs);