gpsa / sql-dump-parser
There is no license information available for the latest version (dev-master) of this package.
SQL Dump Parser
dev-master
2018-11-17 04:18 UTC
Requires
- php: ^5.5 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^4.0 || ^5.0 || ^6.0 || ^7.0
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2024-09-17 17:57:30 UTC
README
Introduction
This project aims to help on parsing SQL Dump Files.
Installation
You need Composer:
composer require gpsa/sql-dump-parser
Usage
-
Load String:
$parser = new MySQL(); $parser->loadString($sql, $startLine);
-
Load File:
$startLine is optional and tells which line of file/string to start iterating$parser = new MySQL(); $parser->loadFile($sql, $startLine);
-
Iterating Queries:
# After loading the file/string we can Iterate and get all files foreach ($parser->getNext() as $item) { echo "{$item->getLine()} - {$item->getSql()}"; }
For more detailed examples, I suggest see tests folder.