lordsimal/cakephp-dump-sql
Composer 安装命令:
composer require lordsimal/cakephp-dump-sql
包简介
A plugin to export SQL for CakePHP
README 文档
README
This plugin adds a CakePHP command to easily generate SQL dumps of your configured datasources
Currently the following DBMS are integrated:
- MySQL/MariaDB
- SQLite
- PostgreSQL
Version table
| PHP | CakePHP | |
|---|---|---|
| 1.x | ^7.4 || ^8.0 |
^4.4 |
| 2.x | ^8.1 |
^5.0 |
Installation
The recommended way to install this plugin via composer is:
composer require lordsimal/cakephp-dump-sql --dev
Then execute
bin/cake plugin load CakeDumpSql
or add this to your src/Application.php manually
public function bootstrap(): void
{
parent::bootstrap();
// Other plugins
$this->addPlugin('CakeDumpSql');
}
Requirements
For each DBMS you need to have its respective dump tool installed.
- MySQL =>
mysqldump - MariaDB =>
mariadb-dump - SQLite =>
sqlite3 - PostgreSQL =>
pg_dump
Warning
For pg_dump it is especially important that you have a compatible version installed. So e.g. if you have a PostgreSQL 14 server you need a pg_dump version 14 ⚠️
How to use
After installing the plugin you now have a new command available to you:
bin/cake dump_sql
After executing that command you should see a SQL representation of your default datasource inside your console.
So if you want to save it into a file you should do
bin/cake dump_sql > dump.sql
Dump different datasource
You can specify which datasource you want to export via the first argument
bin/cake dump_sql test > test_dump.sql
GZIP compressed dump
Note
The following feature requires you have the PHP zlib extension installed and active️
bin/cake dump_sql --gzip > dump.sql.gz
Data only dump
bin/cake dump_sql --data-only > data.sql
lordsimal/cakephp-dump-sql 适用场景与选型建议
lordsimal/cakephp-dump-sql 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.53k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sql」 「plugin」 「dump」 「cakephp」 「export」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lordsimal/cakephp-dump-sql 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lordsimal/cakephp-dump-sql 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lordsimal/cakephp-dump-sql 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This package will add the `dd` and `dump` helpers to your Phalcon application.
CakePHP 4.x AdminLTE Theme.
Simple Twig extension improving templates debugging
nice output for debug functions for PHP 5.3
Query filtering in your frontend
Database/ORM-agnostic query construction helper
统计信息
- 总下载量: 4.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-27