Completed
Push — master ( 6adfd5...8dd9a1 )
by Rasmus
02:23
created

PostgresDatabase   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 47
ccs 4
cts 4
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A select() 0 4 1
A insert() 0 4 1
A update() 0 4 1
A delete() 0 4 1
A createDriver() 0 4 1
1
<?php
2
3
namespace mindplay\sql\postgres;
4
5
use mindplay\sql\framework\Database;
6
use mindplay\sql\model\Table;
7
8
class PostgresDatabase extends Database
9
{
10
    /**
11
     * @param Table $from
12
     *
13
     * @return PostgresSelectQuery
14
     */
15
    public function select(Table $from)
16
    {
17
        return $this->container->create(PostgresSelectQuery::class, ['root' => $from]);
18
    }
19
    
20
    /**
21
     * @param Table $into
22
     *
23
     * @return PostgresInsertQuery
24
     */
25 1
    public function insert(Table $into)
26
    {
27 1
        return $this->container->create(PostgresInsertQuery::class, ['table' => $into]);
28
    }
29
30
    /**
31
     * @param Table $table
32
     *
33
     * @return PostgresUpdateQuery
34
     */
35
    public function update(Table $table)
36
    {
37
        return $this->container->create(PostgresUpdateQuery::class, ['root' => $table]);
38
    }
39
40
    /**
41
     * @param Table $table
42
     *
43
     * @return PostgresDeleteQuery
44
     */
45
    public function delete(Table $table)
46
    {
47
        return $this->container->create(PostgresDeleteQuery::class, ['root' => $table]);
48
    }
49
    
50 1
    protected function createDriver()
51
    {
52 1
        return new PostgresDriver();
53
    }
54
}
55