Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rexshijaku committed May 18, 2021
2 parents ea7ee0b + 5fd4a92 commit 4c96999
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Marwan - SQLToLaravelBuilder
# Marwan - SQL-To-Laravel-Builder
SQL to Laravel Query Builder, A Converter written in PHP

### Features
Expand Down Expand Up @@ -35,7 +35,7 @@ use RexShijaku\SQLToLaravelBuilder;
require_once dirname(__FILE__) . './vendor/autoload.php';

$options = array('facade' => 'DB::');
$converter = new SQLToLaravelBuilder();
$converter = new SQLToLaravelBuilder($options);

$sql = "SELECT COUNT(*) FROM members";
echo $converter->convert($sql);
Expand Down Expand Up @@ -91,14 +91,23 @@ Some important options are briefly explained below:
| group | boolean | true | Whether it should group key value pairs into a php array, or generate separate commands for each pair. See an example <a href="https://github.com/rexshijaku/sql-to-laravel-builder/tree/main/examples/where.php" target="_blank">here</a>. |


### How does it works?
Will be explained soon.
### How does it works ?
SQL-To-Laravel-Builder is built on top of <a href="hhttps://github.com/greenlion/PHP-SQL-Parser">PHP-SQL-Parser</a>. While <a href="hhttps://github.com/greenlion/PHP-SQL-Parser">PHP-SQL-Parser</a> is responsible for parsing the given SQL Query as input. The result of the <a href="hhttps://github.com/greenlion/PHP-SQL-Parser">PHP-SQL-Parser</a> is the input of SQL-To-Laravel-Builder.

The structure has three main parts :
1) Extractors classes - which help to pull out SQL Query parts in a way which are more understandable and processable by Builders.
2) Builder classes - which help to construct Query Builder methods.
3) Creator - which orchestrates the process between Extractors and Builders in order to produce parts of Query Builder.

### Known issues
Will be explained soon.
- It is not tested in all cases. Tests should be added.
- Poor error handling.

### Contributions
Feel free to contribute on development, testing or eventual bug reporting.

### Support
For general questions about Marwan - SQLToLaravelBuilder, tweet at @rexshijaku or write me an email on [email protected].
For general questions about Marwan - SQL-To-Laravel-Builder, tweet at @rexshijaku or write me an email on [email protected].
To have a quick tutorial check the examples folder provided in the repository.

### Author
Expand Down

0 comments on commit 4c96999

Please sign in to comment.