PostgresConnection::getDefaultPostProcessor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php namespace Bosnadev\Database;
2
3
use Illuminate\Database\PostgresConnection as BasePostgresConnection;
4
5
/**
6
 * Class PostgresConnection
7
 *
8
 * @package Bosnadev\Database
9
 */
10
class PostgresConnection extends BasePostgresConnection
11
{
12
    /**
13
     * Get a schema builder instance for the connection.
14
     *
15
     * @return Schema\Builder
16
     */
17
    public function getSchemaBuilder()
18
    {
19
        if (is_null($this->schemaGrammar)) {
20
            $this->useDefaultSchemaGrammar();
21
        }
22
23
        return new Schema\Builder($this);
24
    }
25
26
    /**
27
     * Get the default query grammar instance.
28
     *
29
     * @return \Illuminate\Database\Grammar
30
     */
31 3
    protected function getDefaultQueryGrammar()
32
    {
33 3
        return $this->withTablePrefix(new Query\Grammars\PostgresGrammar);
34
    }
35
36
37
    /**
38
     * Get the default schema grammar instance.
39
     *
40
     * @return \Illuminate\Database\Grammar
41
     */
42
    protected function getDefaultSchemaGrammar()
43
    {
44
        return $this->withTablePrefix(new Schema\Grammars\PostgresGrammar);
45
    }
46
47
48
    /**
49
     * Get the default post processor instance.
50
     *
51
     * @return \Illuminate\Database\Query\Processors\PostgresProcessor
52
     */
53 3
    protected function getDefaultPostProcessor()
54
    {
55 3
        return new \Illuminate\Database\Query\Processors\PostgresProcessor;
56
    }
57
}
58