Skip to content

Read SQL file, remove all vomentarys and separete each command for manipulation.

License

Notifications You must be signed in to change notification settings

pedrosoares/sqlfileloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SqlFileLoader

Read the SQL file, remove all comments, and separate each command for manipulation.

Instation

Put in your composer file the command bellow.

"pedrosoares/sqlfileloader": "1.0.*"

The field "require" shoud be like:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "pedrosoares/sqlfileloader": "1.0.*"
}

How use

To load a file and get all sql commands, you can do in this way:

$c = new SqlFileLoader("PATH to the sql file");
foreach($c->getStatements() as $sqlCommand){
    DB::statement($sqlCommand);
}

About

Read SQL file, remove all vomentarys and separete each command for manipulation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages