数据库管理工具
Go to file
2025-12-31 22:36:40 +08:00
.vscode fix 2025-12-30 14:04:10 +08:00
dist fix 2025-12-31 22:36:40 +08:00
electron Add blowfish-node dependency and implement Navicat password decryption functionality in the Electron app. Enhanced main.js and preload.js for cryptographic operations, updated UI components to support new features, and improved database connection handling. 2025-12-31 22:32:07 +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 fix 2025-12-31 22:36:40 +08:00
scripts fix 2025-12-31 22:36:40 +08:00
src fix 2025-12-31 22:36:40 +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 blowfish-node dependency and implement Navicat password decryption functionality in the Electron app. Enhanced main.js and preload.js for cryptographic operations, updated UI components to support new features, and improved database connection handling. 2025-12-31 22:32:07 +08:00
package.json fix 2025-12-31 22:36:40 +08:00
postcss.config.js fisrt 2025-12-29 18:35:04 +08:00
README.md fix 2025-12-31 22:36:40 +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 fix 2025-12-31 22:36:40 +08:00

🗄️ EasySQL

EasySQL Electron React TypeScript Node.js

现代化多数据库管理工具

轻量、高性能、跨平台


特性

  • 🚀 跨平台 - 基于 Electron支持 Windows、macOS、Linux
  • 高性能 - 原生数据库驱动,毫秒级响应
  • 🎨 精美 UI - 简约现代浅色主题,圆角设计,柔和阴影
  • 🔌 多数据库 - 支持 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 v2.0                                    ─  □  ✕     │
├────────────────┬────────────────────────────────────────────────┤
│                │  🏠 主页  │  📝 查询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
├── scripts/
│   ├── bump-version.js    # 版本号递增脚本
│   └── generate-icons.js  # 图标生成脚本
├── 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+C 复制选中单元格
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 打包应用(自动递增补丁版本)
npm run electron:build:minor 打包应用(递增次版本)
npm run electron:build:major 打包应用(递增主版本)
npm run version:patch 只递增补丁版本号
npm run version:minor 只递增次版本号
npm run version:major 只递增主版本号
npm run icons 生成应用图标

📋 版本号管理

项目使用语义化版本号 (SemVer)主版本.次版本.补丁版本

# 递增补丁版本 2.0.0 -> 2.0.1
npm run version:patch

# 递增次版本 2.0.0 -> 2.1.0
npm run version:minor

# 递增主版本 2.0.0 -> 3.0.0
npm run version:major

# 构建时自动递增版本号
npm run electron:build        # patch
npm run electron:build:minor  # minor
npm run electron:build:major  # major

🤝 贡献

欢迎提交 Issue 和 Pull Request

📄 License

MIT


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