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

PostgresDatabase::insert()   A

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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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