-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #2893 from simPod/master
PostgreSQL 10 support
- Loading branch information
Showing
13 changed files
with
199 additions
and
96 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
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
19 changes: 19 additions & 0 deletions
19
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL100Keywords.php
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Platforms\Keywords; | ||
|
||
/** | ||
* PostgreSQL 10.0 reserved keywords list. | ||
*/ | ||
class PostgreSQL100Keywords extends PostgreSQL94Keywords | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() : string | ||
{ | ||
return 'PostgreSQL100'; | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Platforms; | ||
|
||
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords; | ||
|
||
/** | ||
* Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform. | ||
*/ | ||
class PostgreSQL100Platform extends PostgreSQL94Platform | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getReservedKeywordsClass() : string | ||
{ | ||
return PostgreSQL100Keywords::class; | ||
} | ||
|
||
public function getListSequencesSQL($database) : string | ||
{ | ||
return "SELECT sequence_name AS relname, | ||
sequence_schema AS schemaname, | ||
minimum_value AS min_value, | ||
increment AS increment_by | ||
FROM information_schema.sequences | ||
WHERE sequence_catalog = " . $this->quoteStringLiteral($database) . " | ||
AND sequence_schema NOT LIKE 'pg\_%' | ||
AND sequence_schema != 'information_schema'"; | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
tests/Doctrine/Tests/DBAL/Platforms/PostgreSQL100PlatformTest.php
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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\DBAL\Platforms; | ||
|
||
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; | ||
|
||
class PostgreSQL100PlatformTest extends PostgreSQL94PlatformTest | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function createPlatform() : PostgreSQL100Platform | ||
{ | ||
return new PostgreSQL100Platform(); | ||
} | ||
|
||
public function testGetListSequencesSQL() : void | ||
{ | ||
self::assertSame( | ||
"SELECT sequence_name AS relname, | ||
sequence_schema AS schemaname, | ||
minimum_value AS min_value, | ||
increment AS increment_by | ||
FROM information_schema.sequences | ||
WHERE sequence_catalog = 'test_db' | ||
AND sequence_schema NOT LIKE 'pg\_%' | ||
AND sequence_schema != 'information_schema'", | ||
$this->_platform->getListSequencesSQL('test_db') | ||
); | ||
} | ||
} |
Oops, something went wrong.