-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missed array type cast functions
- Loading branch information
Showing
6 changed files
with
120 additions
and
0 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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pfilsx\PostgreSQLDoctrine\ORM\Query\AST\Functions; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] type for bigint. | ||
* | ||
* @see https://www.postgresql.org/docs/current/arrays.html | ||
* | ||
* @example BIGINT_ARRAY('1', '2', '3') | ||
* @example BIGINT_ARRAY(:input) | ||
*/ | ||
class ToBigIntArray extends ToArray | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
return parent::getSql($sqlWalker) . '::bigint[]'; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pfilsx\PostgreSQLDoctrine\ORM\Query\AST\Functions; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] type for booleans. | ||
* | ||
* @see https://www.postgresql.org/docs/current/arrays.html | ||
* | ||
* @example BOOLEAN_ARRAY(1, 0, 1) | ||
* @example BOOLEAN_ARRAY(:input) | ||
*/ | ||
class ToBooleanArray extends ToArray | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
return parent::getSql($sqlWalker) . '::boolean[]'; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pfilsx\PostgreSQLDoctrine\ORM\Query\AST\Functions; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] type for integers. | ||
* | ||
* @see https://www.postgresql.org/docs/current/arrays.html | ||
* | ||
* @example INT_ARRAY('1', '2', '3') | ||
* @example INT_ARRAY(:input) | ||
*/ | ||
class ToIntArray extends ToArray | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
return parent::getSql($sqlWalker) . '::integer[]'; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pfilsx\PostgreSQLDoctrine\ORM\Query\AST\Functions; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] type for smallint. | ||
* | ||
* @see https://www.postgresql.org/docs/current/arrays.html | ||
* | ||
* @example SMALLINT_ARRAY('1', '2', '3') | ||
* @example SMALLINT_ARRAY(:input) | ||
*/ | ||
class ToSmallIntArray extends ToArray | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
return parent::getSql($sqlWalker) . '::smallint[]'; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pfilsx\PostgreSQLDoctrine\ORM\Query\AST\Functions; | ||
|
||
use Doctrine\ORM\Query\SqlWalker; | ||
|
||
/** | ||
* Implementation of PostgreSql ARRAY[] type for texts. | ||
* | ||
* @see https://www.postgresql.org/docs/current/arrays.html | ||
* | ||
* @example TEXT_ARRAY(1, 2, 3) | ||
* @example TEXT_ARRAY(:input) | ||
*/ | ||
class ToTextArray extends ToArray | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
return parent::getSql($sqlWalker) . '::text[]'; | ||
} | ||
} |