|
8 | 8 | use Throwable;
|
9 | 9 | use Yiisoft\Db\Driver\Pdo\AbstractPdoConnection;
|
10 | 10 | use Yiisoft\Db\Driver\Pdo\PdoCommandInterface;
|
| 11 | +use Yiisoft\Db\Mysql\Column\ColumnFactory; |
11 | 12 | use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
|
| 13 | +use Yiisoft\Db\Schema\Column\ColumnFactoryInterface; |
12 | 14 | use Yiisoft\Db\Schema\QuoterInterface;
|
13 | 15 | use Yiisoft\Db\Schema\SchemaInterface;
|
14 | 16 | use Yiisoft\Db\Transaction\TransactionInterface;
|
@@ -63,30 +65,23 @@ public function createTransaction(): TransactionInterface
|
63 | 65 | return new Transaction($this);
|
64 | 66 | }
|
65 | 67 |
|
| 68 | + public function getColumnFactory(): ColumnFactoryInterface |
| 69 | + { |
| 70 | + return new ColumnFactory(); |
| 71 | + } |
| 72 | + |
66 | 73 | public function getQueryBuilder(): QueryBuilderInterface
|
67 | 74 | {
|
68 |
| - return $this->queryBuilder ??= new QueryBuilder( |
69 |
| - $this->getQuoter(), |
70 |
| - $this->getSchema(), |
71 |
| - $this->getServerInfo(), |
72 |
| - ); |
| 75 | + return $this->queryBuilder ??= new QueryBuilder($this); |
73 | 76 | }
|
74 | 77 |
|
75 | 78 | public function getQuoter(): QuoterInterface
|
76 | 79 | {
|
77 |
| - if ($this->quoter === null) { |
78 |
| - $this->quoter = new Quoter('`', '`', $this->getTablePrefix()); |
79 |
| - } |
80 |
| - |
81 |
| - return $this->quoter; |
| 80 | + return $this->quoter ??= new Quoter('`', '`', $this->getTablePrefix()); |
82 | 81 | }
|
83 | 82 |
|
84 | 83 | public function getSchema(): SchemaInterface
|
85 | 84 | {
|
86 |
| - if ($this->schema === null) { |
87 |
| - $this->schema = new Schema($this, $this->schemaCache); |
88 |
| - } |
89 |
| - |
90 |
| - return $this->schema; |
| 85 | + return $this->schema ??= new Schema($this, $this->schemaCache); |
91 | 86 | }
|
92 | 87 | }
|
0 commit comments