Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f00ff0e
Add upsert check for tenant per doc
abnegate Apr 7, 2025
673e1eb
Add upsert support for tenant per document
abnegate Apr 7, 2025
e19972c
Merge branch 'main' into feat-doc-per-tenant-upsert
abnegate Apr 7, 2025
54e7585
Refix alias
abnegate Apr 7, 2025
ddbecc7
Revert key check changes
abnegate Apr 7, 2025
894b66b
Pass tenant count
abnegate Apr 7, 2025
072f7e1
Shift binds
abnegate Apr 7, 2025
355f48c
Fix permissions check
abnegate Apr 7, 2025
27c442c
Fix bind
abnegate Apr 7, 2025
14b4e18
Add test for upsert with tenant per doc
abnegate Apr 7, 2025
9faf41f
Fix tenant cache
abnegate Apr 7, 2025
5b46bb6
Abstract upsert to sql level
abnegate Apr 7, 2025
15ef5e7
Reset tenant per doc
abnegate Apr 7, 2025
0a13fec
Fix brace
abnegate Apr 7, 2025
5d75600
Fix quote
abnegate Apr 7, 2025
7ec486b
Move back to mariadb
abnegate Apr 7, 2025
43fb280
Early return for tests
abnegate Apr 7, 2025
e68457f
Add test inside upsert supported check
abnegate Apr 7, 2025
4ea7629
Allow internal collection/tenant select
abnegate Apr 7, 2025
6066b98
Select tenant if shared tables
abnegate Apr 7, 2025
a9eafb0
Upsert event
abnegate Apr 7, 2025
dceb80f
Fix size
abnegate Apr 7, 2025
e700f9f
Fix permissions
abnegate Apr 7, 2025
893c47c
Add extra tests
abnegate Apr 7, 2025
453cd2b
Remove redundant check
abnegate Apr 8, 2025
24f97a1
Ensure tenant isn't being changed at app level
abnegate Apr 8, 2025
1a0267c
Fix tenant scoping
abnegate Apr 8, 2025
5d47ee4
Fix tenant scoping
abnegate Apr 8, 2025
261c025
Remove redundant forUpdate
abnegate Apr 8, 2025
16683ce
Compare to existing doc permissions instead of refetching for all ups…
abnegate Apr 8, 2025
97cda21
Fix types
abnegate Apr 9, 2025
0a83108
Add change class for upsert diffs
abnegate Apr 9, 2025
0843c35
Move tenant setter to shared tables check
abnegate Apr 9, 2025
4084205
Param name change
abnegate Apr 9, 2025
7a59393
Name fix
abnegate Apr 9, 2025
e4544d0
Format + stan
abnegate Apr 9, 2025
e0f27a9
Clean cache per batch
abnegate Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,14 @@ protected function trigger(string $event, mixed $query): mixed
return $query;
}

/**
* Quote a string
*
* @param string $string
* @return string
*/
abstract protected function quote(string $string): string;

/**
* Ping Database
*
Expand Down Expand Up @@ -685,13 +693,13 @@ abstract public function updateDocuments(string $collection, Document $updates,
*
* @param string $collection
* @param string $attribute
* @param array<Document> $documents
* @param array<Change> $changes
* @return array<Document>
*/
abstract public function createOrUpdateDocuments(
string $collection,
string $attribute,
array $documents
array $changes
): array;

/**
Expand Down Expand Up @@ -1124,8 +1132,8 @@ abstract public function getSchemaAttributes(string $collection): array;
* Get the query to check for tenant when in shared tables mode
*
* @param string $collection The collection being queried
* @param string $parentAlias The alias of the parent collection if in a subquery
* @param string $alias The alias of the parent collection if in a subquery
* @return string
*/
abstract public function getTenantQuery(string $collection, string $parentAlias = ''): string;
abstract public function getTenantQuery(string $collection, string $alias = ''): string;
}
Loading