We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0749d6 commit 12d2184Copy full SHA for 12d2184
README.md
@@ -1,2 +1,26 @@
1
# php-stream-parse-sql
2
PHP library to parse large SQL files command-by-command
3
+
4
+It's not a real SQL parser though, it only cares about command integrity, but not syntax.
5
6
+### Install:
7
8
+```
9
+composer require lajosbencz/stream-parse-sql
10
11
12
+### Usage:
13
14
+```php
15
+$parser = new LajosBencz\StreamParseSql\StreamParseSql("./my/large/file.sql");
16
+$parser->onProgress(function($position, $size) {
17
+ echo ($position / $size) * 100, PHP_EOL;
18
+});
19
+foreacH($parser->parse() as $sqlCommand) {
20
+ /** @var stdClass $myDb some database adapter */
21
+ $myDb->execute($sqlCommand);
22
+}
23
24
25
+### Todo:
26
+ * Extensively test if any input can produce a malformed command
0 commit comments