1 |
cb15593b
|
Cajova-Houba
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace Illuminate\Database;
|
4 |
|
|
|
5 |
|
|
use Illuminate\Database\Schema\PostgresBuilder;
|
6 |
|
|
use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineDriver;
|
7 |
|
|
use Illuminate\Database\Query\Processors\PostgresProcessor;
|
8 |
|
|
use Illuminate\Database\Query\Grammars\PostgresGrammar as QueryGrammar;
|
9 |
|
|
use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar;
|
10 |
|
|
|
11 |
|
|
class PostgresConnection extends Connection
|
12 |
|
|
{
|
13 |
|
|
/**
|
14 |
|
|
* Get a schema builder instance for the connection.
|
15 |
|
|
*
|
16 |
|
|
* @return \Illuminate\Database\Schema\PostgresBuilder
|
17 |
|
|
*/
|
18 |
|
|
public function getSchemaBuilder()
|
19 |
|
|
{
|
20 |
|
|
if (is_null($this->schemaGrammar)) {
|
21 |
|
|
$this->useDefaultSchemaGrammar();
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
return new PostgresBuilder($this);
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* Get the default query grammar instance.
|
29 |
|
|
*
|
30 |
|
|
* @return \Illuminate\Database\Query\Grammars\PostgresGrammar
|
31 |
|
|
*/
|
32 |
|
|
protected function getDefaultQueryGrammar()
|
33 |
|
|
{
|
34 |
|
|
return $this->withTablePrefix(new QueryGrammar);
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
/**
|
38 |
|
|
* Get the default schema grammar instance.
|
39 |
|
|
*
|
40 |
|
|
* @return \Illuminate\Database\Schema\Grammars\PostgresGrammar
|
41 |
|
|
*/
|
42 |
|
|
protected function getDefaultSchemaGrammar()
|
43 |
|
|
{
|
44 |
|
|
return $this->withTablePrefix(new SchemaGrammar);
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
/**
|
48 |
|
|
* Get the default post processor instance.
|
49 |
|
|
*
|
50 |
|
|
* @return \Illuminate\Database\Query\Processors\PostgresProcessor
|
51 |
|
|
*/
|
52 |
|
|
protected function getDefaultPostProcessor()
|
53 |
|
|
{
|
54 |
|
|
return new PostgresProcessor;
|
55 |
|
|
}
|
56 |
|
|
|
57 |
|
|
/**
|
58 |
|
|
* Get the Doctrine DBAL driver.
|
59 |
|
|
*
|
60 |
|
|
* @return \Doctrine\DBAL\Driver\PDOPgSql\Driver
|
61 |
|
|
*/
|
62 |
|
|
protected function getDoctrineDriver()
|
63 |
|
|
{
|
64 |
|
|
return new DoctrineDriver;
|
65 |
|
|
}
|
66 |
|
|
}
|