Skip to content

Commit 48d31cc

Browse files
committed
Update according to changes in db
1 parent 4e9fa61 commit 48d31cc

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

src/Connection.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ public function getLastInsertID(string $sequenceName = null): string
7373

7474
public function getQueryBuilder(): QueryBuilderInterface
7575
{
76-
if ($this->queryBuilder === null) {
77-
$this->queryBuilder = new QueryBuilder($this->getQuoter(), $this->getSchema());
78-
}
79-
80-
return $this->queryBuilder;
76+
return $this->queryBuilder ??= new QueryBuilder(
77+
$this->getQuoter(),
78+
$this->getSchema(),
79+
$this->getServerInfo(),
80+
);
8181
}
8282

8383
public function getQuoter(): QuoterInterface

src/QueryBuilder.php

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Yiisoft\Db\Oracle;
66

7+
use Yiisoft\Db\Connection\ServerInfoInterface;
78
use Yiisoft\Db\Constant\ColumnType;
89
use Yiisoft\Db\Constant\PseudoType;
910
use Yiisoft\Db\Oracle\Column\ColumnDefinitionBuilder;
@@ -47,14 +48,17 @@ final class QueryBuilder extends AbstractQueryBuilder
4748
PseudoType::UUID_PK => 'RAW(16) DEFAULT SYS_GUID() PRIMARY KEY',
4849
];
4950

50-
public function __construct(QuoterInterface $quoter, SchemaInterface $schema)
51+
public function __construct(QuoterInterface $quoter, SchemaInterface $schema, ServerInfoInterface $serverInfo)
5152
{
52-
$ddlBuilder = new DDLQueryBuilder($this, $quoter, $schema);
53-
$dmlBuilder = new DMLQueryBuilder($this, $quoter, $schema);
54-
$dqlBuilder = new DQLQueryBuilder($this, $quoter);
55-
$columnDefinitionBuilder = new ColumnDefinitionBuilder($this);
56-
57-
parent::__construct($quoter, $schema, $ddlBuilder, $dmlBuilder, $dqlBuilder, $columnDefinitionBuilder);
53+
parent::__construct(
54+
$quoter,
55+
$schema,
56+
$serverInfo,
57+
new DDLQueryBuilder($this, $quoter, $schema),
58+
new DMLQueryBuilder($this, $quoter, $schema),
59+
new DQLQueryBuilder($this, $quoter),
60+
new ColumnDefinitionBuilder($this),
61+
);
5862
}
5963

6064
protected function prepareBinary(string $binary): string

tests/SchemaTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function testGetSchemaNames(): void
9292

9393
$schema = $db->getSchema();
9494

95-
if (version_compare($db->getServerVersion(), '12', '>')) {
95+
if (version_compare($db->getServerInfo()->getVersion(), '12', '>')) {
9696
$this->assertContains('SYSBACKUP', $schema->getSchemaNames());
9797
} else {
9898
$this->assertEmpty($schema->getSchemaNames());

0 commit comments

Comments
 (0)