Initialize complete Wails (Go + React) database management tool
## Project Structure
- Frontend: React 18 + TypeScript + Vite
- Backend: Go 1.23 + Gin + GORM + SQLite + Zap
- Desktop: Wails v2
## Features Implemented
### UI/UX Design
- Complete design system with colors, typography, spacing
- Wireframes for all major screens
- User flows and interaction specifications
- Layout design with 3-panel architecture
### Frontend Components
- ConnectionPanel: Database connection sidebar with status indicators
- AppLayout: Resizable main layout framework
- MenuBar & ToolBar: Navigation and quick actions
- QueryEditor: SQL editor with syntax highlighting support
- DataGrid: Sortable, filterable, editable data table
- TableStructure: Table metadata viewer
- StatusBar: Connection info and query statistics
- StatusIndicator: Animated connection status component
### Backend Services
- Wails bindings: 15+ methods exposed to frontend
- Connection management: CRUD operations with connection pooling
- Query execution: SQL execution with result handling
- Table metadata: Schema introspection
- Encryption service: AES-256-GCM password encryption
- HTTP API: RESTful endpoints for debugging/integration
### Documentation
- Design system specification
- Feature requirements document
- Wireframes and user flows
- API testing guide
- Project README
## Technical Details
- Password encryption using AES-256-GCM
- Thread-safe connection manager with sync.RWMutex
- Unified error handling and logging
- Clean architecture with dependency injection
- SQLite for storing user data (connections, history)
🤖 Generated with Qoder
75 lines
2.0 KiB
Go
75 lines
2.0 KiB
Go
package models
|
|
|
|
import "errors"
|
|
|
|
// Application errors
|
|
var (
|
|
// ErrNotFound resource not found
|
|
ErrNotFound = errors.New("resource not found")
|
|
|
|
// ErrAlreadyExists resource already exists
|
|
ErrAlreadyExists = errors.New("resource already exists")
|
|
|
|
// ErrValidationFailed validation failed
|
|
ErrValidationFailed = errors.New("validation failed")
|
|
|
|
// ErrUnauthorized unauthorized access
|
|
ErrUnauthorized = errors.New("unauthorized access")
|
|
|
|
// ErrForbidden forbidden access
|
|
ErrForbidden = errors.New("forbidden access")
|
|
|
|
// ErrInternalServer internal server error
|
|
ErrInternalServer = errors.New("internal server error")
|
|
|
|
// ErrConnectionFailed connection failed
|
|
ErrConnectionFailed = errors.New("connection failed")
|
|
|
|
// ErrQueryFailed query execution failed
|
|
ErrQueryFailed = errors.New("query execution failed")
|
|
|
|
// ErrEncryptionFailed encryption/decryption failed
|
|
ErrEncryptionFailed = errors.New("encryption/decryption failed")
|
|
|
|
// ErrInvalidConfig invalid configuration
|
|
ErrInvalidConfig = errors.New("invalid configuration")
|
|
|
|
// ErrDatabaseLocked database is locked
|
|
ErrDatabaseLocked = errors.New("database is locked")
|
|
|
|
// ErrTimeout operation timeout
|
|
ErrTimeout = errors.New("operation timeout")
|
|
)
|
|
|
|
// ErrorCode represents error codes for API responses
|
|
type ErrorCode string
|
|
|
|
const (
|
|
// CodeSuccess successful operation
|
|
CodeSuccess ErrorCode = "SUCCESS"
|
|
|
|
// CodeNotFound resource not found
|
|
CodeNotFound ErrorCode = "NOT_FOUND"
|
|
|
|
// CodeValidation validation error
|
|
CodeValidation ErrorCode = "VALIDATION_ERROR"
|
|
|
|
// CodeUnauthorized unauthorized
|
|
CodeUnauthorized ErrorCode = "UNAUTHORIZED"
|
|
|
|
// CodeForbidden forbidden
|
|
CodeForbidden ErrorCode = "FORBIDDEN"
|
|
|
|
// CodeInternal internal error
|
|
CodeInternal ErrorCode = "INTERNAL_ERROR"
|
|
|
|
// CodeConnection connection error
|
|
CodeConnection ErrorCode = "CONNECTION_ERROR"
|
|
|
|
// CodeQuery query error
|
|
CodeQuery ErrorCode = "QUERY_ERROR"
|
|
|
|
// CodeEncryption encryption error
|
|
CodeEncryption ErrorCode = "ENCRYPTION_ERROR"
|
|
)
|