Skip to content

Commit dc9c4a6

Browse files
authored
Merge pull request #551 from utopia-php/feat-doc-per-tenant-upsert
Feat doc per tenant upsert
2 parents 20e2a51 + e0f27a9 commit dc9c4a6

File tree

9 files changed

+1537
-1328
lines changed

9 files changed

+1537
-1328
lines changed

composer.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Adapter.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,14 @@ protected function trigger(string $event, mixed $query): mixed
419419
return $query;
420420
}
421421

422+
/**
423+
* Quote a string
424+
*
425+
* @param string $string
426+
* @return string
427+
*/
428+
abstract protected function quote(string $string): string;
429+
422430
/**
423431
* Ping Database
424432
*
@@ -685,13 +693,13 @@ abstract public function updateDocuments(string $collection, Document $updates,
685693
*
686694
* @param string $collection
687695
* @param string $attribute
688-
* @param array<Document> $documents
696+
* @param array<Change> $changes
689697
* @return array<Document>
690698
*/
691699
abstract public function createOrUpdateDocuments(
692700
string $collection,
693701
string $attribute,
694-
array $documents
702+
array $changes
695703
): array;
696704

697705
/**
@@ -1124,8 +1132,8 @@ abstract public function getSchemaAttributes(string $collection): array;
11241132
* Get the query to check for tenant when in shared tables mode
11251133
*
11261134
* @param string $collection The collection being queried
1127-
* @param string $parentAlias The alias of the parent collection if in a subquery
1135+
* @param string $alias The alias of the parent collection if in a subquery
11281136
* @return string
11291137
*/
1130-
abstract public function getTenantQuery(string $collection, string $parentAlias = ''): string;
1138+
abstract public function getTenantQuery(string $collection, string $alias = ''): string;
11311139
}

0 commit comments

Comments
 (0)