展示:图形化 SQL 构建器与调试器
Show HN: Graphical SQL Builder and Debugger

原始链接: https://github.com/webofmarius/SQLJoiner

这款适用于 MySQL 的可视化 SQL 查询生成器,允许用户通过将表拖放到画布上、建立连接以及定义条件来构建复杂的查询,无需手动编写代码。它支持子查询、DISTINCT、列别名以及各种连接类型(INNER、LEFT、RIGHT、FULL、CROSS),并为每个子句提供可视化界面和原始 SQL 模式。 主要功能包括: * **直观的 UI**:拖放式表管理、带分页的结果网格以及画布搜索。 * **查询灵活性**:导入现有 SQL 以进行可视化图表逆向工程、保存/恢复工作区状态(上下文)以及添加注释。 * **高级管理**:多连接配置、查询取消以及撤销/重做功能。 从技术角度来看,该工具轻量且具有高度可移植性。它主要运行于 PHP 8+ 环境,可通过简单的本地 PHP 服务器部署,或封装在 Electron 外壳中,以便在 Windows、macOS 和 Linux 上获得原生桌面体验。其架构采用模块化设计,使用 PDO 进行数据库连接,并使用 JSON 存储配置,使其成为一种稳健且依赖项极少的视觉化数据库交互解决方案。

```Hacker News新帖 | 往事 | 评论 | 提问 | 展示 | 招聘 | 提交登录Show HN: 图形化 SQL 构建与调试器 (github.com/webofmarius)4 分,由 matei88 发布于 1 小时前 | 隐藏 | 往事 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索: ```
相关文章

原文

A visual SQL query builder for MySQL.

Build SELECT queries by dragging tables onto a canvas, connecting them with joins, and setting conditions — all without writing SQL by hand.

SQL Joiner screenshot

  • Visual canvas — drag tables from the sidebar onto the canvas, then draw join lines between columns
  • Join types — INNER, LEFT, RIGHT, FULL OUTER, CROSS
  • SELECT builder — pick columns visually or switch to raw SQL mode; supports column aliases, DISTINCT, custom expressions, and alpha sort
  • WHERE / GROUP BY / HAVING / ORDER BY — visual or raw SQL mode for each clause
  • Subqueries — add a subquery as a named table on the canvas
  • Import SQLpaste an existing query to reverse-engineer it onto the canvas
  • Contexts — save and restore canvas states (tables, joins, conditions)
  • Notes — attach freeform notes to a context
  • Connection profiles — store multiple MySQL connection profiles; switch between them from the top bar
  • Query cancellation — cancel a running query mid-execution
  • Results grid — paginated results with copy-to-clipboard support
  • Canvas search — find tables, aliases, joins, or island labels
Layer Technology
Desktop shell Electron (optional)
Backend PHP (built-in CLI server)
Frontend Vanilla JS + Canvas API
  • PHP 8+ — required (the only hard dependency)
  • Node.js + Electron — optional, only needed if you want the desktop app wrapper or to build installers
  • Packaged app: PHP binary is bundled (Windows & Mac builds include it under php-bin/)

Without Electron (PHP only)

The simplest way to run the app — just PHP:

cd app
php -S localhost:8080

Then open http://localhost:8080 in your browser.

With Electron (desktop app)

Requires Node.js.

npm run build:mac    # macOS DMG
npm run build:win    # Windows installer (NSIS)
npm run build:linux  # Linux AppImage

Output goes to dist/.

app/
  src/
    Core/       Request, Response, ContextManager, AboutManager
    Database/   Connection (PDO), ProfileManager, SchemaInspector
    Query/      QueryBuilder, QueryParser, JoinClause, WhereClause,
                GroupByClause, HavingClause, OrderByClause
  assets/
    js/         Canvas, joins, islands, autocomplete, undo/redo, results, profiles, api
  storage/      Connection profiles and saved contexts (JSON)
electron/
  main.js       Electron entry — starts the PHP server, opens the window
php-bin/        Bundled PHP binaries (win/, mac/, linux/)

Profiles are stored in app/storage/profiles.json. Each profile holds host, port, database, user, and password. Manage them via Profiles in the top bar.

联系我们 contact @ memedata.com