tiny / sql
SQL 解析库
dev-master
2017-10-29 20:24 UTC
This package is auto-updated.
Last update: 2024-09-16 22:11:47 UTC
README
关于
当前包包含一个有用的组件,功能是将包含多个SQL语句的字符串分割成单独的语句数组。主要作为Tiny/DbUnit项目的辅助工具开发。
示例
$inputString = 'CREATE TABLE tbl (col TEXT); INSERT INTO tbl (col) VALUES ("one;");'; $splitter = Tiny\Sql\Parsers\StatementsSplitter::make(); $statements = $splitter->parse($inputString); foreach($statements as $statement){ print $statement."\n"; } // CREATE TABLE tbl (col TEXT ) ; // INSERT INTO tbl ( col ) VALUES ( "one;" ) ;
安装
composer require tiny/sql