Failed Conditions
Pull Request — develop (#3348)
by Sergei
10:40
created

PostgreSQL100Platform   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 24
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getReservedKeywordsClass() 0 3 1
A getListSequencesSQL() 0 14 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Platforms;
6
7
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
8
9
/**
10
 * Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
11
 */
12
class PostgreSQL100Platform extends PostgreSQL94Platform
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 1353
    protected function getReservedKeywordsClass() : string
18
    {
19 1353
        return PostgreSQL100Keywords::class;
20
    }
21
22 1311
    public function getListSequencesSQL(?string $database) : string
23
    {
24 1311
        if ($database !== null) {
25 1311
            $catalogExpression = $this->quoteStringLiteral($database);
26
        } else {
27
            $catalogExpression = '(SELECT current_catalog)';
28
        }
29
30
        return 'SELECT sequence_name AS relname,
31
                       sequence_schema AS schemaname,
32
                       minimum_value AS min_value, 
33
                       increment AS increment_by
34
                FROM   information_schema.sequences
35 1311
                WHERE  sequence_catalog = ' . $catalogExpression . "
36
                AND    sequence_schema NOT LIKE 'pg\_%'
37
                AND    sequence_schema != 'information_schema'";
38
    }
39
}
40