Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tuananhnghiem committed Sep 9, 2019
1 parent d139712 commit 03b0939
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Version 2.0.0 (new version)

1. Fix the selectRaw rendering
2. Adding parameters to whereRaw(), havingRaw(), orderByRaw() methods
3. Add options to set quotes for identifiers
4. Make default not use quotes for identifiers
5. SQLServer: Generate correct query for limit and offset
6. Query: Add groupByRaw() method
7. Query: Add create() static function to create query from array
8. Query: Adding toArray() function to export query to array format
9. Query: Add fill() method to quickly fill query with array
1. `Query`: Fix the selectRaw rendering
2. `Query`: Adding parameters to `whereRaw()`, `havingRaw()`, `orderByRaw()` methods
3. `SQL`: Add options to set quotes for identifiers
4. `SQL`: Make default not use quotes for identifiers
5. `SQLServer`: Generate correct query for limit and offset
6. `Query`: Add `groupByRaw()` method
7. `Query`: Add `create()` static function to create query from array
8. `Query`: Adding `toArray()` function to export query to array format
9. `Query`: Add `fill()` method to quickly fill query with array

## Version 1.5.0

Expand Down
2 changes: 0 additions & 2 deletions Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,7 @@ public function fill($arr)
if ($arr!==null) {
$arr = $this->rebuildSubQueries($arr);
foreach ($arr as $key=>$value) {
if (isset($this->$key)) {
$this->$key = $value;
}
}
}
}
Expand Down
17 changes: 16 additions & 1 deletion tests/unit/koolreport/querybuilder/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,24 @@ public function testCreate()
$query = Query::create([
"type"=>"select",
"tables"=>["orders"],
"limit"=>2
]);
$sql = $query->toMySQL();
$this->assertEquals($sql, "SELECT * FROM orders");
$this->assertEquals("SELECT * FROM orders LIMIT 2",$sql);
}

public function testToArray()
{
$query = Query::create([
"type"=>"select",
"tables"=>["orders"],
"limit"=>2,
"offset"=>3,
"distinct"=>true,
"lock"=>true,
]);
$str_arr = json_encode($query->toArray());
$this->assertEquals("abc",$str_arr);
}

public function testSerialize()
Expand Down

0 comments on commit 03b0939

Please sign in to comment.