PHPackages                             tworzenieweb/sql-provisioner - 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. [CLI &amp; Console](/categories/cli)
4. /
5. tworzenieweb/sql-provisioner

ActiveLibrary[CLI &amp; Console](/categories/cli)

tworzenieweb/sql-provisioner
============================

Simple CLI tool for validating SQL files before inserting them into DB.

v0.6.0(7y ago)2931[1 issues](https://github.com/tworzenieweb/sql-provisioner/issues)MITPHPPHP &gt;=7.0

Since May 3Pushed 7y ago3 watchersCompare

[ Source](https://github.com/tworzenieweb/sql-provisioner)[ Packagist](https://packagist.org/packages/tworzenieweb/sql-provisioner)[ RSS](/packages/tworzenieweb-sql-provisioner/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (17)Versions (16)Used By (0)

[![Build Status](https://camo.githubusercontent.com/c7d73027f065f389dc4755990e07e41cd66f1d6bedf7d01c8fee7835206bbe00/68747470733a2f2f7472617669732d63692e6f72672f74776f727a656e69657765622f73716c2d70726f766973696f6e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tworzenieweb/sql-provisioner)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2686e130a1c829ff24c0237df2a23e08f5c7d9576519384a331d5aa08f24b3c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74776f727a656e69657765622f73716c2d70726f766973696f6e65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tworzenieweb/sql-provisioner/?branch=master)

[![SensioLabsInsight](https://camo.githubusercontent.com/0c7c5033add37735f4fffc75be256da14773349f8b75a72647069eb75baba299/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f30363464366237612d353434642d346638302d386637622d6534656266656562333238322f6269672e706e67)](https://insight.sensiolabs.com/projects/064d6b7a-544d-4f80-8f7b-e4ebfeeb3282)

SQL Provisioner
===============

[](#sql-provisioner)

Simple CLI tool for database changes deploying. It allows to review each dbdeploy file before executution.

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

[](#prerequisites)

To use this library, you would need to have `composer` installed and have a table for storing already performed DB deploys. Lastly, you would need to provide `.env` file with connection information and table and column name for checks

```
DATABASE_USER=[user]
DATABASE_PASSWORD=[password]
DATABASE_HOST=[host]
DATABASE_PORT=[port]
DATABASE_NAME=[database]
PROVISIONING_TABLE=changelog_database_deployments
PROVISIONING_TABLE_CANDIDATE_NUMBER_COLUMN=deploy_script_number

```

### Installing

[](#installing)

It installs just like any other composer project

```
composer require tworzenieweb/sql-provisioner

```

Then you should be able to run command from vendor/bin/sql-provisioner

```
vendor/bin/sql-provisioner /location/to/your/sql/files

```

### Using

[](#using)

The `vendor/bin/sql-provisioner [path-to-folder]` command will scan the content of \[path-to-folder\] directory.

The script will look for `.env` file containing connection information in format:

```
DATABASE_USER=[user]
DATABASE_PASSWORD=[password]
DATABASE_HOST=[host]
DATABASE_PORT=[port]
DATABASE_NAME=[database]
PROVISIONING_TABLE=changelog_database_deployments
PROVISIONING_TABLE_CANDIDATE_NUMBER_COLUMN=deploy_script_number

```

If you want to create initial .env use `--init`

`vendor/bin/sql-provisioner --init [path-to-folder]`

The next step is searching for sql files and trying to queue them in numerical order. First n-th digits of a filename will be treated as candidate number. This will be used then to check in database if a certain file was already deployed (PROVISIONING\_TABLE\_CANDIDATE\_NUMBER\_COLUMN). Before the insert, it will print the formatted output of a file and result of internal syntax check. Then you can either skip or execute each.

If you would like to skip already provisioned candidates use `--skip-provisioned`If you would like to skip syntax checking (for speed purpose) of candidates use `--skip-syntax-check`

### Demo

[](#demo)

This is cinerama demo of usage

[![asciicast](https://camo.githubusercontent.com/7b7733b2aaa45a5ae7d9d8218ec72448ab462569ced4b0ac3ed633045a2c8ffb/68747470733a2f2f61736369696e656d612e6f72672f612f37376b6b7766706b79396f696f396931326c6a7769333433362e706e67)](http://asciinema.org/a/77kkwfpky9oio9i12ljwi3436)

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/tworzenieweb/sql-provisioner/releases).

Authors
-------

[](#authors)

- **Luke Adamczewski** - *Initial work* - [tworzenieweb](https://github.com/tworzenieweb)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.3% 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 ~48 days

Recently: every ~83 days

Total

15

Last Release

2618d ago

PHP version history (2 changes)v0.0.6PHP &gt;=5.6

v0.4.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b128f73b3a24c3e32838c73825c02bf6abecb2fa408bfefecfd89a103480e490?d=identicon)[tworzenieweb](/maintainers/tworzenieweb)

---

Top Contributors

[![tworzenieweb](https://avatars.githubusercontent.com/u/741378?v=4)](https://github.com/tworzenieweb "tworzenieweb (26 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (6 commits)")[![ed-posinitskiy](https://avatars.githubusercontent.com/u/4303681?v=4)](https://github.com/ed-posinitskiy "ed-posinitskiy (2 commits)")[![stevleibelt](https://avatars.githubusercontent.com/u/2287220?v=4)](https://github.com/stevleibelt "stevleibelt (1 commits)")

---

Tags

clideploymentmysqlphp

### Embed Badge

![Health badge](/badges/tworzenieweb-sql-provisioner/health.svg)

```
[![Health](https://phpackages.com/badges/tworzenieweb-sql-provisioner/health.svg)](https://phpackages.com/packages/tworzenieweb-sql-provisioner)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

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

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

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

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

PHPackages © 2026

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