承接 mattmilesi/pt-osc-command-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mattmilesi/pt-osc-command-generator

最新稳定版本:0.3.1

Composer 安装命令:

composer require mattmilesi/pt-osc-command-generator

包简介

Generates pt-online-schema-change commands for MySQL, given the ALTER TABLE query

README 文档

README

Generates pt-online-schema-change commands for MySQL, given the ALTER TABLE query.

⚠️ This is an experimental version. Please, do not use it in production.

Installation

composer require mattmilesi/pt-osc-command-generator

Usage

$query = "ALTER TABLE customers ADD COLUMN middle_name VARCHAR(255) NOT NULL AFTER first_name;";
$parser = new \PtOscCommandGenerator\StatementParser($query);
$command = $parser->getCommands()[0]
    ->setDsnOption(\PtOscCommandGenerator\DsnOption::HOST, '<host>')
    ->setDsnOption(\PtOscCommandGenerator\DsnOption::DATABASE, '<database>')
    ->setDsnOption(\PtOscCommandGenerator\DsnOption::USER, '<user>')
    ->setDsnOption(\PtOscCommandGenerator\DsnOption::PASSWORD, '<password>')
    ->setExecuteMode();
$cliCommand = (string)$command;

# getCommands returns an array of Command, each one representing a command to be executed
# $cliCommand: pt-online-schema-change --execute --alter "ADD COLUMN middle_name VARCHAR(255) NOT NULL AFTER first_name" h=<host>,D=<database>,t=customers,u=<user>,p=<password>

License

This project is licensed under the Apache License 2.0.
However, it includes the phpmyadmin/sql-parser library, which is used under GPL 3.0 to ensure compatibility.
See GPL-3.0.txt for details.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-03-03