summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/sql/src/Contract/Adapter.php
blob: 6142626b83527f7feac72a068c4fb624bd36458e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

namespace ipl\Sql\Contract;

use ipl\Sql\Config;
use ipl\Sql\Connection;
use ipl\Sql\QueryBuilder;

interface Adapter extends Quoter
{
    /**
     * Get the DSN string from the given connection configuration
     *
     * @param Config $config
     *
     * @return string
     */
    public function getDsn(Config $config);

    /**
     * Get the PDO connect options based on the specified connection configuration
     *
     * @param Config $config
     *
     * @return array
     */
    public function getOptions(Config $config);

    /**
     * Set the client time zone
     *
     * @param Connection $db
     *
     * @return $this
     */
    public function setClientTimezone(Connection $db);

    /**
     * Register callbacks for query builder events
     *
     * @param QueryBuilder $queryBuilder
     *
     * @return $this
     */
    public function registerQueryBuilderCallbacks(QueryBuilder $queryBuilder);
}