PHPackages                             kodus/sql-splitter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kodus/sql-splitter

Abandoned → [kodus/sql-split](/?search=kodus%2Fsql-split)Library[Utility &amp; Helpers](/categories/utility)

kodus/sql-splitter
==================

A simple facility to split SQL files into individual queries - supports MySQL, PostgreSQL and Microsoft SQL Server

1.0.0(9y ago)325.5k9[2 issues](https://github.com/kodus/sql-splitter/issues)[2 PRs](https://github.com/kodus/sql-splitter/pulls)MITPHPPHP ^7.0

Since May 19Pushed 2y agoCompare

[ Source](https://github.com/kodus/sql-splitter)[ Packagist](https://packagist.org/packages/kodus/sql-splitter)[ RSS](/packages/kodus-sql-splitter/feed)WikiDiscussions php-port Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

SQL Statement Splitter
======================

[](#sql-statement-splitter)

A simple parser to split SQL (and/or DDL) files into individual SQL queries.

This is an *unofficial* PHP port of [SQL-Statement-Parser by TeamSQL](https://github.com/TeamSQL/SQL-Statement-Parser).

[![PHP Version](https://camo.githubusercontent.com/98e06ab279ef7d8f5dc610b12861b445a427f985f0ced740b6982d8fac4b3fe8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e302532422d626c75652e737667)](https://packagist.org/packages/kodus/sql-splitter)[![Build Status](https://camo.githubusercontent.com/a5695290e221d2214afa65dc700f9735952507e1b6a2e0a5087fafb6d0b6c19c/68747470733a2f2f7472617669732d63692e6f72672f6b6f6475732f73716c2d73706c69747465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kodus/sql-splitter)

### Install via Composer

[](#install-via-composer)

```
composer require kodus/sql-splitter

```

### Features

[](#features)

Supported SQL File Formats:

- MySQL
- PostgreSQL
- Microsoft SQL Server

Specifically with support for the following SQL/DDL features:

- SQL and DDL Queries
- Stored procedures, functions, views, etc.
- PostgreSQL's dollar-tags (e.g. `$$` and `$mytag$`, etc.)
- MySQL's `DELIMITER`

Usage
-----

[](#usage)

Pick one of the platform-specific methods:

```
$statements = SQLSplitter::splitMySQL(file_get_contents(...));
$statements = SQLSplitter::splitMSSQL(file_get_contents(...));
$statements = SQLSplitter::splitPostgreSQL(file_get_contents(...));
```

Or dynamically pick one based on the PDO driver-name:

```
$driver = $pdo->getAttribute(PDO::ATTR_DRIVER_NAME);

$statements = SQLSplitter::split($driver, file_get_contents(...));
```

Driver-names are also available as `SQLSplitter` class-constants, e.g. `DB_MYSQL`, `DB_MSSQL` and `DB_PGSQL`.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.5% 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

Unknown

Total

1

Last Release

3332d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5709900?v=4)[Thomas Nordahl Pedersen](/maintainers/thomasnordahl-dk)[@thomasnordahl-dk](https://github.com/thomasnordahl-dk)

![](https://avatars.githubusercontent.com/u/13201214?v=4)[Bo Andersen](/maintainers/boan-jfm)[@boan-jfm](https://github.com/boan-jfm)

![](https://avatars.githubusercontent.com/u/32329468?v=4)[Jesper Østergaard Jensen](/maintainers/JyskFynskeMedierJoej)[@JyskFynskeMedierJoej](https://github.com/JyskFynskeMedierJoej)

![](https://avatars.githubusercontent.com/u/25659854?v=4)[Michelle Fich](/maintainers/mifich)[@mifich](https://github.com/mifich)

---

Top Contributors

[![abacigil](https://avatars.githubusercontent.com/u/759174?v=4)](https://github.com/abacigil "abacigil (17 commits)")[![mindplay-dk](https://avatars.githubusercontent.com/u/103348?v=4)](https://github.com/mindplay-dk "mindplay-dk (16 commits)")

### Embed Badge

![Health badge](/badges/kodus-sql-splitter/health.svg)

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

###  Alternatives

[humanmade/hm-gutenberg-tools

Human Made Gutenberg Tools

188103.6k](/packages/humanmade-hm-gutenberg-tools)[bitgrave/barcode-bundle

provide barcode rendering service into your Symfony2 application.

24447.2k1](/packages/bitgrave-barcode-bundle)

PHPackages © 2026

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