Skip to content

Commit

Permalink
Merge branch '0.53.x' into feat-not-found-exception
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Database/Adapter/Postgres.php
  • Loading branch information
abnegate committed Nov 4, 2024
2 parents 89376bd + 39550cb commit 7c2d68a
Show file tree
Hide file tree
Showing 13 changed files with 2,021 additions and 788 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"Composer\\Config::disableProcessTimeout",
"docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml"
],
"lint": "./vendor/bin/pint --test",
"format": "./vendor/bin/pint",
"lint": "php -d memory_limit=2G ./vendor/bin/pint --test",
"format": "php -d memory_limit=2G ./vendor/bin/pint",
"check": "./vendor/bin/phpstan analyse --level 7 src tests --memory-limit 2G",
"coverage": "./vendor/bin/coverage-check ./tmp/clover.xml 90"
},
Expand All @@ -42,12 +42,12 @@
},
"require-dev": {
"fakerphp/faker": "1.23.*",
"phpunit/phpunit": "9.6.*",
"pcov/clobber": "2.0.*",
"phpunit/phpunit": "9.*",
"pcov/clobber": "2.*",
"swoole/ide-helper": "5.1.3",
"utopia-php/cli": "0.14.*",
"laravel/pint": "1.17.*",
"phpstan/phpstan": "1.11.*",
"laravel/pint": "1.*",
"phpstan/phpstan": "1.*",
"rregeer/phpunit-coverage-check": "0.3.*"
},
"suggests": {
Expand Down
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.

3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"preset": "psr12",
"exclude": [
"vendor"
],
"rules": {
"array_indentation": true,
"single_import_per_statement": true,
Expand Down
30 changes: 25 additions & 5 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,17 +565,19 @@ abstract public function createDocuments(string $collection, array $documents, i
abstract public function updateDocument(string $collection, string $id, Document $document): Document;

/**
* Update Documents in batches
* Update documents
*
* Updates all documents which match the given query.
*
* @param string $collection
* @param Document $updates
* @param array<Document> $documents
* @param int $batchSize
*
* @return array<Document>
* @return int
*
* @throws DatabaseException
*/
abstract public function updateDocuments(string $collection, array $documents, int $batchSize): array;
abstract public function updateDocuments(string $collection, Document $updates, array $documents): int;

/**
* Delete Document
Expand All @@ -587,6 +589,16 @@ abstract public function updateDocuments(string $collection, array $documents, i
*/
abstract public function deleteDocument(string $collection, string $id): bool;

/**
* Delete Documents
*
* @param string $collection
* @param array<string> $ids
*
* @return int
*/
abstract public function deleteDocuments(string $collection, array $ids): int;

/**
* Find Documents
*
Expand All @@ -600,10 +612,11 @@ abstract public function deleteDocument(string $collection, string $id): bool;
* @param array<string> $orderTypes
* @param array<string, mixed> $cursor
* @param string $cursorDirection
* @param string $forPermission
*
* @return array<Document>
*/
abstract public function find(string $collection, array $queries = [], ?int $limit = 25, ?int $offset = null, array $orderAttributes = [], array $orderTypes = [], array $cursor = [], string $cursorDirection = Database::CURSOR_AFTER): array;
abstract public function find(string $collection, array $queries = [], ?int $limit = 25, ?int $offset = null, array $orderAttributes = [], array $orderTypes = [], array $cursor = [], string $cursorDirection = Database::CURSOR_AFTER, string $forPermission = Database::PERMISSION_READ): array;

/**
* Sum an attribute
Expand Down Expand Up @@ -747,6 +760,13 @@ abstract public function getSupportForRelationships(): bool;

abstract public function getSupportForUpdateLock(): bool;

/**
* Are batch operations supported?
*
* @return bool
*/
abstract public function getSupportForBatchOperations(): bool;

/**
* Is attribute resizing supported?
*
Expand Down
Loading

0 comments on commit 7c2d68a

Please sign in to comment.