-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathQueryBuilder.php
More file actions
41 lines (33 loc) · 1014 Bytes
/
Copy pathQueryBuilder.php
File metadata and controls
41 lines (33 loc) · 1014 Bytes
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
<?php
declare(strict_types=1);
namespace Yiisoft\Db\Pgsql;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Db\Pgsql\Column\ColumnDefinitionBuilder;
use Yiisoft\Db\QueryBuilder\AbstractQueryBuilder;
use function bin2hex;
/**
* Implements the PostgreSQL Server specific query builder.
*/
final class QueryBuilder extends AbstractQueryBuilder
{
public function __construct(ConnectionInterface $db)
{
$quoter = $db->getQuoter();
$schema = $db->getSchema();
parent::__construct(
$db,
new DDLQueryBuilder($this, $quoter, $schema),
new DMLQueryBuilder($this, $quoter, $schema),
new DQLQueryBuilder($this, $quoter),
new ColumnDefinitionBuilder($this),
);
}
protected function prepareBinary(string $binary): string
{
return "'\x" . bin2hex($binary) . "'::bytea";
}
protected function createSqlParser(string $sql): SqlParser
{
return new SqlParser($sql);
}
}