V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
noobmaster

最近开发了一个小工具 xsql,让 AI 方便快捷的查询数据库数据

  •  
  •   noobmaster · Feb 5 · 1095 views
    This topic created in 82 days ago, the information mentioned may be changed or developed.

    背景

    用 Claude/Cursor 这类 AI 辅助开发时,经常需要让它查询数据库验证问题,现有的工具都不支持 ssh proxy 并且 pg 和 mysql 要用不同的 mcp

    xsql 做了什么

    • 双重只读保护:SQL 静态分析 + 数据库事务级只读,AI 想写也写不了
    • 结构化输出:JSON 格式输出,AI 解析友好
    • 密钥不落盘:集成 OS Keyring ,密码不会出现在配置文件里
    • SSH 隧道:一行配置连接跳板机后的内网数据库
    • 零依赖:单二进制,brew/scoop 安装

    使用方式

    # 安装
    brew install zx06/tap/xsql
    
    # 查询
    xsql query "SELECT * FROM users" -p prod -f json
    

    支持 Claude Code Plugin 、MCP Server 、Cursor Rules 多种集成方式。

    链接

    GitHub: https://github.com/zx06/xsql

    Go 写的,MIT 协议,欢迎试用和提 Issue 。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   989 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 19:32 · PVG 03:32 · LAX 12:32 · JFK 15:32
    ♥ Do have faith in what you're doing.