npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oh-my-tool/mysql

v0.3.4

Published

MySQL extension for Oh My Tool (read-only query / schema / explain)

Readme

@oh-my-tool/mysql

独立 MySQL 能力扩展仓库(Oh My Tool)。

  • 只读:mysql.instances / mysql.ping / mysql.query / mysql.schema / mysql.explain
  • 契约:omt.manifest.json 声明 sdkVersion,Core 安装/发现时做 SDK 版本兼容校验。
  • 依赖:@oh-my-tool/sdk;发布包会将运行时 bundle 自包含,无需在 Core 的扩展目录中额外安装 SDK。
  • 测试:npm test(handler 逻辑,注入 mock client)。

配置

配置文件位于 %USERPROFILE%\\.oh-my-tool\\config.toml(Linux/macOS 为 ~/.oh-my-tool/config.toml)。

[extensions.mysql.connections.local]
environment = "local"

[extensions.mysql.connections.local.settings]
host = "127.0.0.1"
port = 3306
database = "ohmytool_test"
username = "root"
tls = true

[extensions.mysql.connections.local.secrets]
password = "mysql:local"

secrets.password 只保存密钥引用,不保存密码。设置密码:

"your-password" | ohmytool secret set mysql:local

mysql.querymysql.schemamysql.explain 都只接受已配置的 connection 名称。

mysql.instances 不需要连接名,会列出当前配置的实例(不连接 MySQL,也不显示 secret 名称)。

mysql.ping 检查连接和认证;query、schema、explain 默认最多返回 100 行, 可传 maxRows(上限 1000)和 timeoutMs(上限 30000)。超出限制时返回 truncated: true

ohmytool run mysql.instances
ohmytool run mysql.instances --json
ohmytool run mysql.ping connection=iot-test
ohmytool run mysql.query connection=iot-test sql="SELECT id, name, age FROM users"
ohmytool run mysql.query connection=iot-test sql="SELECT id, name, age FROM users" --json

run 默认以行数组输出查询结果:第一行是列名,后续行是数据;增加 --json 可输出机器可解析的 JSON,也支持 --format=text|json|table|csv

本地联调

npm install
npm test

安装进 Core

npm install @oh-my-tool/mysql
ohmytool extension install ./node_modules/@oh-my-tool/mysql

发布

发布由 GitHub Actions 的 npm Trusted Publisher 完成。创建并推送与 package.jsonomt.manifest.json 一致的版本 tag 即可:

npm run version:release -- 0.2.1
npm install
npm run check
git add -A && git commit -m "release: v0.2.1"
git push origin main
git tag -a v0.2.1 -m "release: v0.2.1"
git push origin v0.2.1