1
|
<?php
|
2
|
|
3
|
namespace Illuminate\Database;
|
4
|
|
5
|
use Illuminate\Database\Schema\MySqlBuilder;
|
6
|
use Illuminate\Database\Query\Processors\MySqlProcessor;
|
7
|
use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver;
|
8
|
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar;
|
9
|
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar;
|
10
|
|
11
|
class MySqlConnection extends Connection
|
12
|
{
|
13
|
/**
|
14
|
* Get a schema builder instance for the connection.
|
15
|
*
|
16
|
* @return \Illuminate\Database\Schema\MySqlBuilder
|
17
|
*/
|
18
|
public function getSchemaBuilder()
|
19
|
{
|
20
|
if (is_null($this->schemaGrammar)) {
|
21
|
$this->useDefaultSchemaGrammar();
|
22
|
}
|
23
|
|
24
|
return new MySqlBuilder($this);
|
25
|
}
|
26
|
|
27
|
/**
|
28
|
* Get the default query grammar instance.
|
29
|
*
|
30
|
* @return \Illuminate\Database\Query\Grammars\MySqlGrammar
|
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\MySqlGrammar
|
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\MySqlProcessor
|
51
|
*/
|
52
|
protected function getDefaultPostProcessor()
|
53
|
{
|
54
|
return new MySqlProcessor;
|
55
|
}
|
56
|
|
57
|
/**
|
58
|
* Get the Doctrine DBAL driver.
|
59
|
*
|
60
|
* @return \Doctrine\DBAL\Driver\PDOMySql\Driver
|
61
|
*/
|
62
|
protected function getDoctrineDriver()
|
63
|
{
|
64
|
return new DoctrineDriver;
|
65
|
}
|
66
|
}
|