-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bc02a6
commit eb64dbe
Showing
45 changed files
with
123 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,57 @@ | ||
# SQLQueryBuilder | ||
|
||
Is a simple SQL query builder in Java | ||
Is a simple SQL query builder in Java\ | ||
Currently it support only MySQL query | ||
|
||
|
||
### HOW TO USE? | ||
|
||
##### scenario 1 | ||
```java | ||
SQLBuilder.getMySQLBuilder().select("fields").from("table").build() | ||
|
||
// RESULT : | ||
// SELECT fields FROM `table`; | ||
``` | ||
|
||
##### scenario 2 | ||
```java | ||
SQLBuilder.getMySQLBuilder().select("fields").from("table").build() | ||
|
||
// RESULT : | ||
// SELECT fields FROM `table`; | ||
``` | ||
|
||
##### scenario 3 | ||
```java | ||
SQLBuilder.getMySQLBuilder().select("field1, field2") | ||
.from("table") | ||
.where().field("field1").isGraterThan("20") | ||
.nextPipe().build(); | ||
|
||
// RESULT : | ||
// SELECT field1, field2 FROM `table` | ||
// WHERE field1 < 20; | ||
|
||
``` | ||
|
||
##### scenario 4 | ||
```java | ||
|
||
SQLBuilder.getMySQLBuilder() | ||
.select( | ||
SQLFun.sum("field").as("sum").transpile() | ||
).from("table1") | ||
.join("table2").leftOuterJoin() | ||
.on("file2").isEqualTo("table1.field").nextPipe() | ||
.where().field("field1").isEqualTo("value").nextPipe() | ||
.orderBy("table1.field").ascending().nextPipe() | ||
.build(); | ||
|
||
// RESULT: | ||
// SELECT SUM(field) as 'sum' FROM `table1` | ||
// LEFT OUTER JOIN `table2` ON table2.file2 = table1.field | ||
// WHERE field1 = value | ||
// ORDER BY table1.field ASC; | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
package Builder.interfaces; | ||
|
||
import com.jiantech.SearchQueryForSQL.Builder.interfaces.Buildable; | ||
|
||
public interface SQLConfiguration { | ||
public Buildable set(String query); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.