-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from nyroDev/update_mariadb
Implement missing MariaDB and update doc to indicate MySQL is compatible
- Loading branch information
Showing
19 changed files
with
268 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_COMPACT" "(" StringPrimary ")" | ||
*/ | ||
class JsonCompact extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_COMPACT'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_DETAILED" "(" StringPrimary " {, " alphaNumeric "})" | ||
*/ | ||
class JsonDetailed extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_DETAILED'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG]; | ||
|
||
/** @var string[] */ | ||
protected $optionalArgumentTypes = [self::ALPHA_NUMERIC]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_EQUALS" "(" StringPrimary ", " StringPrimary ")" | ||
*/ | ||
class JsonEquals extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_EQUALS'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG, self::STRING_PRIMARY_ARG]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_LOOSE" "(" StringPrimary ")" | ||
*/ | ||
class JsonLoose extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_LOOSE'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_NORMALIZE" "(" StringPrimary ")" | ||
*/ | ||
class JsonNormalize extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_NORMALIZE'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mariadb; | ||
|
||
/** | ||
* "JSON_QUERY" "(" StringPrimary "," StringPrimary ")" | ||
*/ | ||
class JsonQuery extends MariadbJsonFunctionNode | ||
{ | ||
public const FUNCTION_NAME = 'JSON_QUERY'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG, self::STRING_PRIMARY_ARG]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Query\AST\Functions\Mysql; | ||
|
||
/** | ||
* "JSON_MERGE_PRESERVE" "(" StringPrimary "," StringPrimary { "," StringPrimary }* ")" | ||
*/ | ||
class JsonMergePreserve extends MysqlJsonFunctionNode | ||
{ | ||
const FUNCTION_NAME = 'JSON_MERGE_PRESERVE'; | ||
|
||
/** @var string[] */ | ||
protected $requiredArgumentTypes = [self::STRING_PRIMARY_ARG, self::STRING_PRIMARY_ARG]; | ||
|
||
/** @var string[] */ | ||
protected $optionalArgumentTypes = [self::STRING_PRIMARY_ARG]; | ||
|
||
/** @var bool */ | ||
protected $allowOptionalArgumentRepeat = true; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonCompactTest extends MariadbTestCase | ||
{ | ||
public function testJsonCompact() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_COMPACT('{\"key1\":123}') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_COMPACT('{\"key1\":123}') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonDetailedTest extends MariadbTestCase | ||
{ | ||
public function testJsonDetailed() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_DETAILED('{\"key1\":123}') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_DETAILED('{\"key1\":123}') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
|
||
public function testJsonDetailedMore() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_DETAILED('{\"key1\":123}', 4) from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_DETAILED('{\"key1\":123}', 4) AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonEqualsTest extends MariadbTestCase | ||
{ | ||
public function testJsonEquals() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_EQUALS('{\"key1\":123}', '{\"key1\":123}') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_EQUALS('{\"key1\":123}', '{\"key1\":123}') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonLooseTest extends MariadbTestCase | ||
{ | ||
public function testJsonLoose() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_LOOSE('{\"key1\":123}') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_LOOSE('{\"key1\":123}') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonNormalizeTest extends MariadbTestCase | ||
{ | ||
public function testJsonNormalize() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_NORMALIZE('{\"key1\":123}') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_NORMALIZE('{\"key1\":123}') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mariadb; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MariadbTestCase; | ||
|
||
class JsonQueryTest extends MariadbTestCase | ||
{ | ||
public function testJsonQuery() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_QUERY('{\"key1\":123}', '$.key1') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_QUERY('{\"key1\":123}', '$.key1') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Scienta\DoctrineJsonFunctions\Tests\Query\Functions\Mysql; | ||
|
||
use Scienta\DoctrineJsonFunctions\Tests\Query\MysqlTestCase; | ||
|
||
class JsonMergePreserveTest extends MysqlTestCase | ||
{ | ||
public function testJsonMergePreserve() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_MERGE_PRESERVE('[1, 2]', '[true, false]') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_MERGE_PRESERVE('[1, 2]', '[true, false]') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
|
||
public function testJsonMergePreserveMore() | ||
{ | ||
$this->assertDqlProducesSql( | ||
"SELECT JSON_MERGE_PRESERVE('[1, 2]', '[true, false]', '[true, false]', '[true, false]') from Scienta\DoctrineJsonFunctions\Tests\Entities\Blank b", | ||
"SELECT JSON_MERGE_PRESERVE('[1, 2]', '[true, false]', '[true, false]', '[true, false]') AS sclr_0 FROM Blank b0_" | ||
); | ||
} | ||
} |
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