class PropelSQLParser
Service class for parsing a large SQL string into an array of SQL statements
Methods
setSQL(string $sql)
Sets the inner SQL string for this object. |
||
string |
getSQL()
Gets the inner SQL string for this object. |
|
static integer |
executeString(string $input, PDO $connection)
Execute a list of DDL statements based on a string Does not use transactions since they are not supported in DDL statements |
|
static integer |
executeFile(string $file, PDO $connection)
Execute a list of DDL statements based on the path to the SQL file Does not use transactions since they are not supported in DDL statements |
|
static array |
parseString(string $input)
Explodes a SQL string into an array of SQL statements. |
|
static array |
parseFile($file)
Explodes a SQL file into an array of SQL statements. |
|
convertLineFeedsToUnixStyle() | ||
stripSQLCommentLines() | ||
array |
explodeIntoStatements()
Explodes the inner SQL string into statements based on the SQL statement delimiter (;) |
|
string |
getNextStatement()
Gets the next SQL statement in the inner SQL string, and advances the cursor to the end of this statement. |
Details
at line 32
public
setSQL(string $sql)
Sets the inner SQL string for this object.
Also resets the parsing cursor (see getNextStatement)
at line 44
public string
getSQL()
Gets the inner SQL string for this object.
at line 58
static public integer
executeString(string $input, PDO $connection)
Execute a list of DDL statements based on a string Does not use transactions since they are not supported in DDL statements
at line 72
static public integer
executeFile(string $file, PDO $connection)
Execute a list of DDL statements based on the path to the SQL file Does not use transactions since they are not supported in DDL statements
at line 124
static public array
parseString(string $input)
Explodes a SQL string into an array of SQL statements.
at line 153
static public array
parseFile($file)
Explodes a SQL file into an array of SQL statements.
at line 162
public
convertLineFeedsToUnixStyle()
at line 167
public
stripSQLCommentLines()
at line 180
public array
explodeIntoStatements()
Explodes the inner SQL string into statements based on the SQL statement delimiter (;)
at line 197
public string
getNextStatement()
Gets the next SQL statement in the inner SQL string, and advances the cursor to the end of this statement.