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

PostgreSQL100Platform::getListSequencesSQL()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.032
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