fixing database connections

This commit is contained in:
2024-09-07 13:22:58 +03:00
parent cf3d621587
commit 0cd4e08716
16 changed files with 119 additions and 79 deletions
+4 -4
View File
@@ -3,7 +3,7 @@
namespace Lucent\Query;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Lucent\Database\Database;
use Lucent\Edge\Edge;
use Lucent\Primitive\Collection;
use Lucent\Query\DatabaseGraph\DatabaseGraph;
@@ -67,7 +67,7 @@ final class Query
$edgesIds = collect($resultParentSourceTargetIds)->merge($resultChildrenEdgesTargetIds)->unique()->values()->toArray();
$edgeRecords = [];
if (!empty($edgesIds)) {
$edgeRecords = DB::table('records')
$edgeRecords = Database::make()->table('records')
->whereIn("id", $edgesIds)
->whereIn("status", $this->options->status)
->get()->toArray();
@@ -142,7 +142,7 @@ final class Query
private function mainQuery(): array
{
$query = DB::table("records");
$query = Database::make()->table("records");
$query = $this->parseFilters($query);
$query = $this->findNotLinked($query);
@@ -189,7 +189,7 @@ final class Query
function runWithCount(): Graph
{
$query = DB::table("records");
$query = Database::make()->table("records");
$query = $this->parseFilters($query);
$query = $this->findNotLinked($query);
$graph = $this->run();