Skip to content

Commit

Permalink
Test DatabaseV2
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitriBouteille committed Mar 10, 2024
1 parent 5feb96e commit 9a1984c
Show file tree
Hide file tree
Showing 5 changed files with 489 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Builders/AbstractWithMetaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Dbout\WpOrm\MetaMappingConfig;
use Dbout\WpOrm\Orm\AbstractModel;
use Dbout\WpOrm\Orm\Database;
use Dbout\WpOrm\Orm\DatabaseV2;
use Illuminate\Database\Eloquent\Model;

/**
Expand Down Expand Up @@ -129,7 +130,7 @@ public function joinToMeta(string $metaKey, string $joinType = 'inner'): self
$join->on(
sprintf('%s.%s', $metaKey, $this->metaConfig?->columnKey),
'=',
Database::getInstance()->raw(sprintf("'%s'", $metaKey))
DatabaseV2::getInstance()->raw(sprintf("'%s'", $metaKey))
)->on(
sprintf('%s.%s', $metaKey, $this->metaConfig?->foreignKey),
'=',
Expand Down
2 changes: 1 addition & 1 deletion src/Orm/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function newBaseQueryBuilder()
public function getConnection()
{
// @phpstan-ignore-next-line
return Database::getInstance();
return DatabaseV2::getInstance();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Orm/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function addWhereExistsQuery(EloquentBuilder $query, $boolean = 'and', $n
*/
public function getConnection(): ConnectionInterface
{
return Database::getInstance();
return DatabaseV2::getInstance();
}
}
Loading

0 comments on commit 9a1984c

Please sign in to comment.