数据库管理工具
Go to file
2025-12-31 15:58:26 +08:00
.vscode fix 2025-12-30 14:04:10 +08:00
dist dist 2025-12-31 13:10:00 +08:00
electron 更新-新增表数据功能 2025-12-31 14:05:51 +08:00
public Add png-to-ico and sharp dependencies; update electron main.js to set dynamic icon path 2025-12-31 12:25:12 +08:00
release dist 2025-12-31 13:10:00 +08:00
scripts Add png-to-ico and sharp dependencies; update electron main.js to set dynamic icon path 2025-12-31 12:25:12 +08:00
src Refactor UI components and enhance functionality with a new clean light theme. Updated Tailwind configuration for colors, shadows, and animations. Improved connection and database modals with better state management and error handling. Added hooks for connection management and query operations. Enhanced sidebar and main content for better user experience. 2025-12-31 15:58:26 +08:00
.gitignore fix 2025-12-30 14:04:10 +08:00
app-icon.svg update 2025-12-31 12:19:05 +08:00
index.html fisrt 2025-12-29 18:35:04 +08:00
localhost update 2025-12-31 12:19:05 +08:00
package-lock.json Add png-to-ico and sharp dependencies; update electron main.js to set dynamic icon path 2025-12-31 12:25:12 +08:00
package.json Add png-to-ico and sharp dependencies; update electron main.js to set dynamic icon path 2025-12-31 12:25:12 +08:00
postcss.config.js fisrt 2025-12-29 18:35:04 +08:00
README.md update 2025-12-31 12:19:05 +08:00
tailwind.config.js Refactor UI components and enhance functionality with a new clean light theme. Updated Tailwind configuration for colors, shadows, and animations. Improved connection and database modals with better state management and error handling. Added hooks for connection management and query operations. Enhanced sidebar and main content for better user experience. 2025-12-31 15:58:26 +08:00
tsconfig.json fisrt 2025-12-29 18:35:04 +08:00
tsconfig.node.json fisrt 2025-12-29 18:35:04 +08:00
vite.config.ts update 2025-12-31 12:19:05 +08:00

🗄️ EasySQL

EasySQL Electron React TypeScript Node.js

现代化多数据库管理工具

轻量、高性能、跨平台


特性

  • 🚀 跨平台 - 基于 Electron支持 Windows、macOS、Linux
  • 高性能 - 原生数据库驱动,毫秒级响应
  • 🎨 精美 UI - Windows Metro 风格,深色主题,无边框窗口
  • 🔌 多数据库 - 支持 MySQL、PostgreSQL、SQLite、SQL Server、MongoDB、Redis、MariaDB
  • 📝 智能编辑器 - Monaco EditorSQL 语法高亮、智能补全
  • 📊 数据编辑 - 支持直接编辑表格数据,虚拟滚动大数据量
  • 🛠️ 表设计器 - Navicat 风格,可视化编辑字段、索引、外键、表选项
  • 🗃️ 完整管理 - 创建/删除/重命名/复制数据库和表
  • 📤 导入导出 - 支持 JSON、Navicat NCX 格式连接配置导入导出
  • 🔄 批量操作 - 支持多选连接批量删除管理

🗃️ 支持的数据库

数据库 状态 驱动
🐬 MySQL mysql2
🐘 PostgreSQL pg
💾 SQLite sql.js
📊 SQL Server mssql
🦭 MariaDB mysql2
🍃 MongoDB mongodb
Redis ioredis

🚀 快速开始

环境要求

  • Node.js 18+
  • npm 或 yarn

安装

# 克隆项目
git clone https://github.com/your-repo/easysql.git
cd easysql

# 安装依赖
npm install

# 开发模式运行
npm run electron:dev

# 构建应用
npm run electron:build

📸 界面预览

┌─────────────────────────────────────────────────────────────────┐
│ 🗄️ EasySQL                                        ─  □  ✕     │
├────────────────┬────────────────────────────────────────────────┤
│                │  🏠 主页  │  📝 查询1  │  📋 users  │  +        │
│ + 新建连接     │ ┌──────────────────────────────────────────┐   │
│                │ │ SELECT * FROM users                      │   │
│ ─ 连接 ─────── │ │ WHERE status = 'active'                  │   │
│                │ │ ORDER BY created_at DESC                 │   │
│ 🐬 MySQL本地   │ │ LIMIT 100;                               │   │
│ 🐘 PostgreSQL  │ ├──────────────────────────────────────────┤   │
│ 📊 SQL Server  │ │ ┌────┬────────┬─────────┬────────────┐   │   │
│                │ │ │ id │ name   │ email   │ created_at │   │   │
│ ─ mydb ─────── │ │ ├────┼────────┼─────────┼────────────┤   │   │
│   📋 users     │ │ │ 1  │ Alice  │ a@...   │ 2024-01-01 │   │   │
│   📋 orders    │ │ │ 2  │ Bob    │ b@...   │ 2024-01-02 │   │   │
│   📋 products  │ │ └────┴────────┴─────────┴────────────┘   │   │
├────────────────┴────────────────────────────────────────────────┤
│ ● 就绪  ·  2 行 (0.05s)                         EasySQL v2.0   │
└─────────────────────────────────────────────────────────────────┘

🛠️ 技术栈

  • 运行时: Electron 33
  • 前端: React 18 + TypeScript 5
  • 样式: Tailwind CSS 3
  • 构建: Vite 5
  • 编辑器: Monaco Editor
  • 数据库驱动: mysql2, pg, sql.js, mssql, mongodb, ioredis

📁 项目结构

easysql/
├── electron/              # Electron 主进程
│   ├── main.js            # 主程序入口
│   └── preload.js         # 预加载脚本
├── src/                   # React 前端
│   ├── components/        # UI 组件
│   │   ├── TitleBar.tsx          # 标题栏
│   │   ├── Sidebar.tsx           # 侧边栏(连接/数据库/表树)
│   │   ├── MainContent.tsx       # 主内容区
│   │   ├── SqlEditor.tsx         # SQL 编辑器Monaco
│   │   ├── VirtualDataTable.tsx  # 虚拟滚动数据表格
│   │   ├── TableDesigner.tsx     # 表设计器Navicat 风格)
│   │   ├── ConnectionModal.tsx   # 连接配置弹窗
│   │   ├── CreateDatabaseModal.tsx  # 新建数据库弹窗
│   │   ├── CreateTableModal.tsx  # 快速新建表弹窗
│   │   └── InputDialog.tsx       # 通用输入对话框
│   ├── lib/
│   │   ├── electron-api.ts    # Electron API 封装
│   │   └── hooks.ts           # 自定义 Hooks
│   ├── App.tsx
│   ├── types.ts
│   └── index.css
├── index.html
├── package.json
├── tailwind.config.js
├── tsconfig.json
└── vite.config.ts

⌨️ 快捷键

快捷键 功能
Ctrl+Enter 执行 SQL
Ctrl+S 保存文件/保存修改
Ctrl+O 打开 SQL 文件
Ctrl+Shift+F 格式化 SQL
Ctrl+Q 新建查询
Ctrl+W 关闭当前标签
Ctrl+F 搜索(侧边栏/表格)
双击连接 快速连接数据库
右键菜单 连接/数据库/表操作

🔧 配置说明

连接配置保存在用户配置目录:

  • Windows: %APPDATA%\easysql\connections.json
  • macOS: ~/Library/Application Support/easysql/connections.json
  • Linux: ~/.config/easysql/connections.json

📦 npm 脚本

命令 说明
npm run dev 启动 Vite 开发服务器
npm run build 构建前端资源
npm run electron:dev 开发模式运行 Electron
npm run electron:build 打包 Electron 应用

🤝 贡献

欢迎提交 Issue 和 Pull Request

📄 License

MIT


Made with ❤️ using Electron + React + Node.js