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.4k9[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 2mo 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 64% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity30

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

3286d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec1a54f85a6e46909df4ca4852ada0cc4b1482f7208dfc487d05554087e09cc9?d=identicon)[thomasnordahl-dk](/maintainers/thomasnordahl-dk)

![](https://www.gravatar.com/avatar/9d0432f9ee26cc6265bcf3817d88bf40a4a8669a603785b34946e9c15d7b3451?d=identicon)[boan-jfm](/maintainers/boan-jfm)

![](https://www.gravatar.com/avatar/22799a8c3c482e408f78fd86a999b271f1d5fd2e04b433c6d199f717b3032bb2?d=identicon)[JyskFynskeMedierJoej](/maintainers/JyskFynskeMedierJoej)

![](https://www.gravatar.com/avatar/a974d9ad4b2be14736394ce117f53f83e9186e9cc05002bc004678f0b0587e37?d=identicon)[mifich](/maintainers/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

[symfony/flex

Composer plugin for Symfony

4.2k182.7M875](/packages/symfony-flex)

PHPackages © 2026

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