ecomdev/mysql-to-jsonl
最新稳定版本:1.4.5
Composer 安装命令:
composer require ecomdev/mysql-to-jsonl
包简介
Export/Import JSONL files as data for MySQL tables
README 文档
README
Purpose:
The mysql2jsonl tool provides an efficient way to export data from a MySQL database to JSONL (JSON Lines) files and to import data back into a database from these files.
It is highly configurable and optimized for performance with concurrency and batching in mind!
Key Features:
-
Export and Import Commands
mysql2jsonl export: Exports MySQL database table data into JSONL files.mysql2jsonl import: Imports JSONL files back into the MySQL database tables.
-
Complex rules for excluding/including tables into the export
-
No compromise on performance!
-
JSONSchema for configuration validation, no more guessing when editing config file.
Configuration file example
If you want to export / import data from mysql server reachable via db hostname
and exclude tables that match indexation patterns, you configuration file will look like this:
{
"$schema": "https://raw.githubusercontent.com/EcomDev/mysql-to-jsonl/main/schema.json",
"config": {
"connection": {
"host": "db",
"database": "magento",
"user": "magento",
"password": "magento"
},
"excludeTables": [
{
"endsWith": "_cl"
},
{
"contains": "_tmp_"
},
{
"contains": "_index_"
},
{
"endsWith": "_index"
},
{
"endsWith": "_replica"
},
{
"regexp": "/^inventory_stock_\\d+$/"
}
],
"concurrency": 12
}
}
Notice the $schema in as the first element? Specifying it like this in your config files
allows your favorite IDE's to auto-complete and validate configuration properties.
Installation
Phar (Recommended)
Download pre-bundled application from Releases
Composer
composer require ecomdev/mysql2jsonl
📜 License
This project is licensed under the MIT License.
See the LICENSE file for more details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 29
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-15