PHPackages                             graze/sprout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. graze/sprout

ActiveLibrary[Database &amp; ORM](/categories/database)

graze/sprout
============

Seed data for your project

0.4.4(4y ago)08[3 issues](https://github.com/graze/sprout/issues)MITPHPPHP ^7.0CI passing

Since Aug 9Pushed 1w ago12 watchersCompare

[ Source](https://github.com/graze/sprout)[ Packagist](https://packagist.org/packages/graze/sprout)[ Docs](https://github.com/graze/sprout)[ RSS](/packages/graze-sprout/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (9)Dependencies (13)Versions (19)Used By (0)

🌱 Sprout
========

[](#-sprout)

[![Latest Version on Packagist](https://camo.githubusercontent.com/29cf7321944c4858f2f977f0e883c57c6f68e977ccd3d61944d7f1b0b79a3dee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772617a652f7370726f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graze/sprout)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![CI](https://camo.githubusercontent.com/8fd5e59f8c5687795f2c2cbf6c97a97c7ac0bf54b4fa66f126f6542317c341f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772617a652f7370726f75742f63692e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d4349)](https://github.com/graze/sprout/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/c3ea23e9e812e17ddd412f558e8fe2ab779a65f6d4df97cd67d333a95daf8439/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772617a652f7370726f75742e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Docker Image Size](https://camo.githubusercontent.com/658c04c7ec299473d17b1a78510e13c8c906bc22113ca677de87b15dd5fb0ca2/68747470733a2f2f696d672e736869656c64732e696f2f6d6963726f6261646765722f696d6167652d73697a652f6772617a652f7370726f75742e7376673f7374796c653d666c61742d737175617265)](https://hub.docker.com/r/graze/sprout/)[![Docker Pulls](https://camo.githubusercontent.com/93ece02ae11d8fda2343ce67f4f9ffcb4debbe783a72ad80dbf3d1993b213234/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f6772617a652f7370726f75742e7376673f7374796c653d666c61742d737175617265)](https://hub.docker.com/r/graze/sprout/)

Sprout is a tool to help Dump, Truncate and Seed development data into your databases.

[![fun image](https://camo.githubusercontent.com/9d6921c4a460dd86f0d2d5c6702c43f4e503159e3d7276e209f3091d0ed1ceea/68747470733a2f2f37382e6d656469612e74756d626c722e636f6d2f35333434323565623131373036343438616638636535383338363239663736642f74756d626c725f696e6c696e655f6e39743867647a43377031717a6a7a68752e676966)](https://camo.githubusercontent.com/9d6921c4a460dd86f0d2d5c6702c43f4e503159e3d7276e209f3091d0ed1ceea/68747470733a2f2f37382e6d656469612e74756d626c722e636f6d2f35333434323565623131373036343438616638636535383338363239663736642f74756d626c725f696e6c696e655f6e39743867647a43377031717a6a7a68752e676966)

1. Seed sql data from local files
2. Dump data from mysql tables
3. Performs actions in parallel
4. Handle multiple groups of seed data (for example, `static`, `core`, `testing`)

Install
-------

[](#install)

Via Composer

```
composer require graze/sprout
```

Via docker

```
docker run -v [volumes] --rm graze/sprout [command]
```

Usage
-----

[](#usage)

See the [full documentation](https://graze.github.io/sprout) for complete usage information.

### File Structure

[](#file-structure)

Sprout will use the following file structure by default, you can change the root and each group's path in the configuration file.

```
- /seed
  - group1
    - schema1
      - table1.sql
      - table2.sql
    - schema2
      - table3.sql
  - group1
    - schema3
      - table4.sql

```

### Quick Start

[](#quick-start)

```
# Dump all tables you are interested in
sprout dump --config=config/sprout.yml --group=static a_schema:table_1,table_2 ...

# Store the data in your repository of choice
git add /seed/static/*

# Seed the data from your local files
sprout seed --config=config/sprout.yml --group=static
```

### Seeding

[](#seeding)

```
sprout seed [--config=] [--group=] [--no-chop|--chop-all] [[:,...]] ...

sprout seed --config=config/sprout.yml the_schema
sprout seed --config=config/sprout.yml --chop-all the_schema
sprout seed --config=config/sprout.yml --no-chop the_schema

sprout seed --config=config/sprout.yml the_schema:country
sprout seed --config=config/sprout.yml --no-chop the_schema:country other_schema:planets

sprout seed --config=config/sprout.yml --group=core
sprout seed --config=config/sprout.yml --group=core the_schema
sprout seed --config=config/sprout.yml --no-chop --group=extra
sprout seed --config=config/sprout.yml --chop-all --group=extra
```

### Truncating the data from all the tables in a schema

[](#truncating-the-data-from-all-the-tables-in-a-schema)

```
sprout chop [--config=] [--group=] [--all] [[:,...]] ...

sprout chop --config=config/sprout.yml the_schema
sprout chop --config=config/sprout.yml the_schema:country
sprout chop --config=config/sprout.yml --all the_schema

sprout chop --config=config/sprout.yml --group=core the_schema
sprout chop --config=config/sprout.yml --group=extra the_schema:country
sprout chop --config=config/sprout.yml --group=extra --all
```

### Dumping the data from all tables in a schema

[](#dumping-the-data-from-all-tables-in-a-schema)

```
sprout dump [--config=] [--group=] [[:,...]] ...

sprout dump --config=config/sprout.yml the_schema
sprout dump --config=config/sprout.yml the_schema:country

sprout dump --config=config/sprout.yml --group=core
sprout dump --config=config/sprout.yml --group=core the_schema:country
```

### Configuration

[](#configuration)

The configuration file follows the following standards.

By default sprout looks for a `config/sprout.yml` file, you can specify a different file using `--config=path/to/file.yml`.

```
defaults:
  group: core
  # default path
  path: /seed
  # number of simultaneous processors to run at a time (default: 10)
  simultaneousProcesses: 10

# ability to specify custom paths for groups
groups:
  core:
    path: /custom/path/to/group

schemas:
  # name of the schema to reference
  :
    # [optional] the actual name of the schema in the database. If not specified,  from above will be used
    schema: 'schema'

    # Connection details - this is just an example, you may want to specify
    # different properties, e.g. if connecting to a remote server. You are
    # advised to refer to the 'pdo' documentation for further details.
    connection:
      user: 'morphism'
      password: 'morphism'
      # driver for the database connection, currently only: `mysql` is supported
      driver: 'mysql'
      # [optional] name of the database
      dbName: 'schema'
      # database on a remote host
      host: 'db'
      # [optional] port to use, by default: 3306
      port: 3306
```

Testing
-------

[](#testing)

```
make build test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Harry Bragg](https://github.com/h-bragg)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance64

Regular maintenance activity

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~132 days

Recently: every ~262 days

Total

9

Last Release

1779d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/637788?v=4)[graze.com](/maintainers/graze)[@graze](https://github.com/graze)

---

Top Contributors

[![rick-lam](https://avatars.githubusercontent.com/u/114425681?v=4)](https://github.com/rick-lam "rick-lam (16 commits)")[![biggianteye](https://avatars.githubusercontent.com/u/1482649?v=4)](https://github.com/biggianteye "biggianteye (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

databasegrazedatabase-seedersprout

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/graze-sprout/health.svg)

```
[![Health](https://phpackages.com/badges/graze-sprout/health.svg)](https://phpackages.com/packages/graze-sprout)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k204.8M440](/packages/doctrine-migrations)[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
