0data

中文文档
1.0.0发布于 2026/05/27ES Module

Minimal CLI for managing a dev AWS RDS MySQL database

原始使用文档

dm

Minimal Deno CLI for managing a dev AWS RDS MySQL database.

Setup

Create the local config file:

deno task dm init

Edit:

~/.config/dm/config.json

Example:

{
  "defaultProfile": "default",
  "profiles": {
    "default": {
      "host": "your-dev-rds.xxxxxx.us-east-1.rds.amazonaws.com",
      "port": 3306,
      "user": "admin",
      "password": "dev-password",
      "database": "app_dev",
      "ssl": {
        "rejectUnauthorized": false
      }
    },
    "other_dev": {
      "host": "your-other-dev-rds.xxxxxx.us-east-1.rds.amazonaws.com",
      "port": 3306,
      "user": "admin",
      "password": "dev-password",
      "database": "other_app_dev",
      "ssl": {
        "rejectUnauthorized": false
      }
    }
  }
}

The init command sets the config directory to 700 and the config file to 600 on Linux.

For a dev RDS instance, "rejectUnauthorized": false is the quickest way to avoid local TLS CA setup. For a stronger setup, download the AWS RDS CA bundle and use:

{
  "ssl": {
    "caPath": "/path/to/global-bundle.pem",
    "rejectUnauthorized": true
  }
}

Commands

deno task dm ping
deno task dm databases
deno task dm tables
deno task dm profile ls
deno task dm profile current
deno task dm profile set default
deno task dm users
deno task dm describe users
deno task dm indexes users
deno task dm indexes users --format json
deno task dm count users
deno task dm bucket ls
deno task dm bucket set my-r2-bucket
deno task dm bucket files
deno task dm export
deno task dm export --prod
deno task dm export --prod --limit 5000

This first version runs with -A through the dm task.

count uses MySQL's information_schema.TABLES.TABLE_ROWS estimate. That is fast for large InnoDB tables, but it is approximate.

Ads exports are grouped by database profile. Samples live in exports/<profile>/sample/; production exports should go in exports/<profile>/production/ after the sample headers and values are approved. Use deno task dm export --prod to write plan exports to the production folder. Sample plan exports default to 100 rows, while --prod defaults to 1000 rows; pass --limit <n> to override either default.

The ads staging exports use the same dataset filenames in both folders: user_profiles.csv, contact_identifiers.csv, and purchase_events.csv. They are raw ClickHouse BI inputs, so nullable source values should be preserved in these files and filtered later in derived audience/upload tables.

Agents should generate exports/<current-profile>/export.config.json for repeatable ads exports. The plan contains table names, source-to-output column mappings, date columns, limits, and output filenames. Once the plan exists, run:

deno task dm export

版本与发布记录

0data 共发布 1 个版本,首次发布于 2026/05/27;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.0.0latest2026/05/275 个月前

关于 0data 的常见问题

0data 是什么?

用于管理开发AWS RDS MySQL数据库的最小CLI

如何安装 0data?

在项目目录运行 npm install 0data,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 0data,可以用 npx 0data 直接运行。

0data 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/0data 是否存在。

0data 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

0data 可以商用吗?

0data 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

0data 还在维护吗?

最新版本 1.0.0 发布于 2026/05/27(5 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/05/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。