承接 lordsimal/cakephp-dump-sql 相关项目开发

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

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

lordsimal/cakephp-dump-sql

最新稳定版本:2.1.0

Composer 安装命令:

composer require lordsimal/cakephp-dump-sql

包简介

A CakePHP 4 plugin to export SQL

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require codecov

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/MariaDB => mysqldump
  • 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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-27