Skip to content

Releases: alexblair/FastSQL2Json

20260104

04 Jan 09:44

Choose a tag to compare

新增命令行模式,更适合crontab场景,命令行新增 自定义配置文件、静态输出、仅故障信息输出。

FastSQL2Json - Convert SQL results to JSON files

Usage: FastSQL2Json [OPTIONS]

Options:
  -c, --config <CONFIG>  Path to the configuration file (default: config.toml in current directory) [default: config.toml]
  -q, --quiet            Disable all output
  -e, --error-only       Only output errors
  -h, --help             Print help
  -V, --version          Print version

2025122

29 Dec 08:30

Choose a tag to compare

基于 ubuntu 环境,理论上 unix环境都可以运行。
下载后,可以解压到任意目录。

修改 config.toml.example 然后另存为 config.toml 就可以执行拉.

执行方式:
$ ./FastSQL2Json

预期出现的结果:

 $ /tmp/FastSQL2Json 
[1766996702] [INFO] - Loaded configuration from config.toml
[1766996702] [INFO] - Connected to MySQL database: online_project_sywz
[1766996702] [INFO] - MySQL version: 8.0.36
[1766996702] [INFO] - Found 1 SQL files in directory: /xxxx/
[1766996702] [INFO] - Successfully executed file: /xxx/abc.sql
[1766996702] [INFO] - Generated JSON file: /xxx/abc.json
[1766996703] [INFO] - All SQL files processed successfully

运行完成后,你就可以在SQL所在的文件目录找到一个 与SQL文件同名的 JSON文件。这个文件很适合做并发抗压,面试官再问你接口并发怎么解决,你可以说“你的八股文过时啦!快用FastSQL2Json!”