Download the PHP package benmorel/smartdump without Composer

On this page you can find all versions of the php package benmorel/smartdump. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smartdump

Smart Dump

Exports a referentially intact subset of a MySQL database.

Note: although this tool targets MySQL only for now, it is designed to be able to support other RDBMS in the future.

License

Introduction

Did you ever need to export just a couple tables from your MySQL database, but end up with broken foreign key constraints? What if you could import every single foreign row your data depends on as well, and nothing more? This tool does just that.

Let's say you want to dump the order_items table below:

If you use mysqldump, you'll get the whole order_items table, with broken foreign key constraints to orders and products.

If you use smartdump instead, you'll get the rows you want from order_items (or the whole table, as you wish), plus the rows from orders and products required to satisfy their constraints, plus, in turn, the rows from users and countries required to satisfy the remaining constraints! 💪

The key takeaway here is that smartdump will only import the rows required to satisfy the constraints of the requested tables/rows.

Installation

The only currently supported installation method is through Composer:

Usage

To dump some tables, just run:

or, if all your tables are in the same database:

To dump only a subset of a table, add extra conditions after the table name:

Or even:

Options

Options that take a value:

Option Description Default value
--host The host name localhost
--port The port number 3306
--user The user name root
--password The password
--charset The character set utf8mb4
--database The database name to prepend to table names

Options that don't take a value:

Option Description
--no-create-table Add this option to not include a CREATE TABLE statement
--add-drop-table Add this option to include a DROP TABLE IF EXISTS statement before CREATE TABLE
--no-schema-name Add this option to not include the schema name in the output; this allows for importing the dump into a schema name other than that of the source database.
--merge Add this option to create a dump that can be merged into an existing schema; this removes CREATE TABLE statements and uses upserts instead of inserts. Implies --no-create-table.

Future scope (todo, ideas)


Database diagram courtesy dbdiagram.io.

Logo by Pixel perfect.


All versions of smartdump with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-pdo Version *
symfony/console Version ^5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package benmorel/smartdump contains the following files

Loading the files please wait ....