From 1d86a6bfe01e7847891e68e8439035cfaeec95fc Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 22 Dec 2025 18:29:16 +0200 Subject: [PATCH 01/11] Migration --- composer.json | 2 +- composer.lock | 181 +++++++----------- src/Migration/Resources/Database/Database.php | 1 + src/Migration/Sources/Appwrite.php | 4 +- src/Migration/Sources/Appwrite/Reader.php | 5 +- src/Migration/Sources/Appwrite/Reader/API.php | 8 +- .../Sources/Appwrite/Reader/Database.php | 6 +- 7 files changed, 89 insertions(+), 118 deletions(-) diff --git a/composer.json b/composer.json index 3b974e0b..967afcef 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "ext-curl": "*", "ext-openssl": "*", "appwrite/appwrite": "15.*", - "utopia-php/database": "3.*", + "utopia-php/database": "dev-joins8 as 4.3.0", "utopia-php/storage": "0.18.*", "utopia-php/dsn": "0.2.*", "utopia-php/console": "0.0.*" diff --git a/composer.lock b/composer.lock index 192872e4..a82c6b11 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8b2b0894b94d976f09044c200956961a", + "content-hash": "a88c69532030d85bb7e9408ccddd8192", "packages": [ { "name": "appwrite/appwrite", @@ -1280,20 +1280,20 @@ }, { "name": "ramsey/uuid", - "version": "4.9.1", + "version": "4.9.2", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440" + "reference": "8429c78ca35a09f27565311b98101e2826affde0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/81f941f6f729b1e3ceea61d9d014f8b6c6800440", - "reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0", + "reference": "8429c78ca35a09f27565311b98101e2826affde0", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -1352,9 +1352,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.9.1" + "source": "https://github.com/ramsey/uuid/tree/4.9.2" }, - "time": "2025-09-04T20:59:21+00:00" + "time": "2025-12-14T04:43:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2068,16 +2068,16 @@ }, { "name": "utopia-php/cache", - "version": "0.13.1", + "version": "0.13.2", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "97220cb3b3822b166ee016d1646e2ae2815dc540" + "reference": "5768498c9f451482f0bf3eede4d6452ddcd4a0f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/97220cb3b3822b166ee016d1646e2ae2815dc540", - "reference": "97220cb3b3822b166ee016d1646e2ae2815dc540", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/5768498c9f451482f0bf3eede4d6452ddcd4a0f6", + "reference": "5768498c9f451482f0bf3eede4d6452ddcd4a0f6", "shasum": "" }, "require": { @@ -2086,7 +2086,7 @@ "ext-redis": "*", "php": ">=8.0", "utopia-php/pools": "0.8.*", - "utopia-php/telemetry": "0.1.*" + "utopia-php/telemetry": "*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -2114,9 +2114,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.13.1" + "source": "https://github.com/utopia-php/cache/tree/0.13.2" }, - "time": "2025-05-09T14:43:52+00:00" + "time": "2025-12-17T08:55:43+00:00" }, { "name": "utopia-php/compression", @@ -2214,16 +2214,16 @@ }, { "name": "utopia-php/database", - "version": "3.5.0", + "version": "dev-joins8", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "5da71b65a6123ce2e78795522b05b7458aabfbd7" + "reference": "a732ab42c10bf2dbe499f7c9c2c4918baa656a52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/5da71b65a6123ce2e78795522b05b7458aabfbd7", - "reference": "5da71b65a6123ce2e78795522b05b7458aabfbd7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/a732ab42c10bf2dbe499f7c9c2c4918baa656a52", + "reference": "a732ab42c10bf2dbe499f7c9c2c4918baa656a52", "shasum": "" }, "require": { @@ -2266,9 +2266,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/3.5.0" + "source": "https://github.com/utopia-php/database/tree/joins8" }, - "time": "2025-11-18T08:11:01+00:00" + "time": "2025-12-18T13:55:36+00:00" }, { "name": "utopia-php/dsn", @@ -2319,23 +2319,21 @@ }, { "name": "utopia-php/framework", - "version": "0.33.33", + "version": "0.33.11", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "838e3a28276e73187bc34a314f014096dc92191b" + "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/838e3a28276e73187bc34a314f014096dc92191b", - "reference": "838e3a28276e73187bc34a314f014096dc92191b", + "url": "https://api.github.com/repos/utopia-php/http/zipball/354ff0d23bfc6e82bea0fe8e89e115cff1af8466", + "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466", "shasum": "" }, "require": { - "php": ">=8.1", - "utopia-php/compression": "0.1.*", - "utopia-php/telemetry": "0.1.*", - "utopia-php/validators": "0.1.*" + "php": ">=8.0", + "utopia-php/compression": "0.1.*" }, "require-dev": { "laravel/pint": "^1.2", @@ -2361,9 +2359,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.33" + "source": "https://github.com/utopia-php/http/tree/0.33.11" }, - "time": "2025-11-25T10:21:13+00:00" + "time": "2024-11-08T18:47:43+00:00" }, { "name": "utopia-php/mongo", @@ -2428,21 +2426,21 @@ }, { "name": "utopia-php/pools", - "version": "0.8.2", + "version": "0.8.3", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "05c67aba42eb68ac65489cc1e7fc5db83db2dd4d" + "reference": "ad7d6ba946376e81c603204285ce9a674b6502b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/05c67aba42eb68ac65489cc1e7fc5db83db2dd4d", - "reference": "05c67aba42eb68ac65489cc1e7fc5db83db2dd4d", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/ad7d6ba946376e81c603204285ce9a674b6502b8", + "reference": "ad7d6ba946376e81c603204285ce9a674b6502b8", "shasum": "" }, "require": { - "php": ">=8.3", - "utopia-php/telemetry": "0.1.*" + "php": ">=8.4", + "utopia-php/telemetry": "*" }, "require-dev": { "laravel/pint": "1.*", @@ -2474,22 +2472,22 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/0.8.2" + "source": "https://github.com/utopia-php/pools/tree/0.8.3" }, - "time": "2025-04-17T02:04:54+00:00" + "time": "2025-12-17T09:35:18+00:00" }, { "name": "utopia-php/storage", - "version": "0.18.16", + "version": "0.18.19", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "0c7b8ad68de8e1eb23ccc8af9f27a30eb832930f" + "reference": "9c3f9a471250d22de7d405ee19e23e72b14181ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/0c7b8ad68de8e1eb23ccc8af9f27a30eb832930f", - "reference": "0c7b8ad68de8e1eb23ccc8af9f27a30eb832930f", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/9c3f9a471250d22de7d405ee19e23e72b14181ca", + "reference": "9c3f9a471250d22de7d405ee19e23e72b14181ca", "shasum": "" }, "require": { @@ -2505,7 +2503,7 @@ "php": ">=8.1", "utopia-php/framework": "0.*.*", "utopia-php/system": "0.*.*", - "utopia-php/telemetry": "0.1.*" + "utopia-php/telemetry": "0.2.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -2532,9 +2530,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.16" + "source": "https://github.com/utopia-php/storage/tree/0.18.19" }, - "time": "2025-12-03T02:15:45+00:00" + "time": "2025-12-17T13:55:20+00:00" }, { "name": "utopia-php/system", @@ -2594,32 +2592,37 @@ }, { "name": "utopia-php/telemetry", - "version": "0.1.1", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/telemetry.git", - "reference": "437f0021777f0e575dfb9e8a1a081b3aed75e33f" + "reference": "9997ebf59bb77920a7223ad73d834a76b09152c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/437f0021777f0e575dfb9e8a1a081b3aed75e33f", - "reference": "437f0021777f0e575dfb9e8a1a081b3aed75e33f", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/9997ebf59bb77920a7223ad73d834a76b09152c3", + "reference": "9997ebf59bb77920a7223ad73d834a76b09152c3", "shasum": "" }, "require": { "ext-opentelemetry": "*", "ext-protobuf": "*", - "nyholm/psr7": "^1.8", - "open-telemetry/exporter-otlp": "^1.1", - "open-telemetry/sdk": "^1.1", + "nyholm/psr7": "1.*", + "open-telemetry/exporter-otlp": "1.*", + "open-telemetry/sdk": "1.*", "php": ">=8.0", - "symfony/http-client": "^7.1" + "symfony/http-client": "7.*" }, "require-dev": { - "laravel/pint": "^1.2", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.5.25" + "laravel/pint": "1.*", + "phpbench/phpbench": "1.*", + "phpstan/phpstan": "2.*", + "phpunit/phpunit": "11.*", + "swoole/ide-helper": "6.*" + }, + "suggest": { + "ext-sockets": "Required for the Swoole transport implementation", + "ext-swoole": "Required for the Swoole transport implementation" }, "type": "library", "autoload": { @@ -2638,54 +2641,9 @@ ], "support": { "issues": "https://github.com/utopia-php/telemetry/issues", - "source": "https://github.com/utopia-php/telemetry/tree/0.1.1" - }, - "time": "2025-03-17T11:57:52+00:00" - }, - { - "name": "utopia-php/validators", - "version": "0.1.0", - "source": { - "type": "git", - "url": "https://github.com/utopia-php/validators.git", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/5c57d5b6cf964f8981807c1d3ea8df620c869080", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080", - "shasum": "" - }, - "require": { - "php": ">=8.0" - }, - "require-dev": { - "laravel/pint": "1.*", - "phpstan/phpstan": "1.*", - "phpunit/phpunit": "11.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "Utopia\\": "src/" - } + "source": "https://github.com/utopia-php/telemetry/tree/0.2.0" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A lightweight collection of reusable validators for Utopia projects", - "keywords": [ - "php", - "utopia", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.1.0" - }, - "time": "2025-11-18T11:05:46+00:00" + "time": "2025-12-17T07:56:38+00:00" } ], "packages-dev": [ @@ -4966,9 +4924,18 @@ "time": "2025-04-30T23:37:27+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-joins8", + "alias": "4.3.0", + "alias_normalized": "4.3.0.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Migration/Resources/Database/Database.php b/src/Migration/Resources/Database/Database.php index 06882b21..8a911c41 100644 --- a/src/Migration/Resources/Database/Database.php +++ b/src/Migration/Resources/Database/Database.php @@ -38,6 +38,7 @@ public function __construct( * updatedAt: string, * enabled: bool, * originalId: string|null, + * type: string|null, * } $array */ public static function fromArray(array $array): self diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index 4216d40f..9bdbf0cf 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -1143,7 +1143,9 @@ private function exportRows(int $batchSize): void } /** @var Column|Relationship $attribute */ - $queries[] = $this->database->querySelect($selects); + foreach ($selects as $select) { + $queries[] = $this->database->querySelect($select); + } $response = $this->database->listRows($table, $queries); diff --git a/src/Migration/Sources/Appwrite/Reader.php b/src/Migration/Sources/Appwrite/Reader.php index b45f2bdc..5a217894 100644 --- a/src/Migration/Sources/Appwrite/Reader.php +++ b/src/Migration/Sources/Appwrite/Reader.php @@ -2,6 +2,7 @@ namespace Utopia\Migration\Sources\Appwrite; +use Utopia\Database\Query; use Utopia\Migration\Resource; use Utopia\Migration\Resources\Database\Database; use Utopia\Migration\Resources\Database\Table; @@ -77,10 +78,10 @@ public function getRow(Table $resource, string $rowId, array $queries = []): arr /** * Return a query to select the given attributes * - * @param array $columns + * @param string $column * @return QueryType|string */ - public function querySelect(array $columns): mixed; + public function querySelect(string $column): mixed; /** * Return a query to filter the given attributes diff --git a/src/Migration/Sources/Appwrite/Reader/API.php b/src/Migration/Sources/Appwrite/Reader/API.php index da1a5022..20141b00 100644 --- a/src/Migration/Sources/Appwrite/Reader/API.php +++ b/src/Migration/Sources/Appwrite/Reader/API.php @@ -205,12 +205,12 @@ public function getRow(Table $resource, string $rowId, array $queries = []): arr } /** - * @param array $columns - * @return string + * @param string $column + * @return Query */ - public function querySelect(array $columns): string + public function querySelect(string $column): string { - return Query::select($columns); + return Query::select($column); } /** diff --git a/src/Migration/Sources/Appwrite/Reader/Database.php b/src/Migration/Sources/Appwrite/Reader/Database.php index c43e246c..8b6e1f5d 100644 --- a/src/Migration/Sources/Appwrite/Reader/Database.php +++ b/src/Migration/Sources/Appwrite/Reader/Database.php @@ -353,12 +353,12 @@ public function getRow(TableResource $resource, string $rowId, array $queries = } /** - * @param array $columns + * @param string $column * @return Query */ - public function querySelect(array $columns): Query + public function querySelect(string $column): Query { - return Query::select($columns); + return Query::select($column); } /** From ae04b1154faf89e40f197f01e83519fde0861b3c Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 22 Dec 2025 18:39:24 +0200 Subject: [PATCH 02/11] Migration --- src/Migration/Sources/Appwrite/Reader/API.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Migration/Sources/Appwrite/Reader/API.php b/src/Migration/Sources/Appwrite/Reader/API.php index 20141b00..02e2ef2e 100644 --- a/src/Migration/Sources/Appwrite/Reader/API.php +++ b/src/Migration/Sources/Appwrite/Reader/API.php @@ -210,7 +210,10 @@ public function getRow(Table $resource, string $rowId, array $queries = []): arr */ public function querySelect(string $column): string { - return Query::select($column); + /** + * Hack turn to array until fix + */ + return Query::select([$column]); } /** From 98dd1459120da7d5f03f360814a0dce8ac9569da Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 22 Dec 2025 18:43:45 +0200 Subject: [PATCH 03/11] select --- src/Migration/Sources/Appwrite/Reader/API.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Migration/Sources/Appwrite/Reader/API.php b/src/Migration/Sources/Appwrite/Reader/API.php index 02e2ef2e..20141b00 100644 --- a/src/Migration/Sources/Appwrite/Reader/API.php +++ b/src/Migration/Sources/Appwrite/Reader/API.php @@ -210,10 +210,7 @@ public function getRow(Table $resource, string $rowId, array $queries = []): arr */ public function querySelect(string $column): string { - /** - * Hack turn to array until fix - */ - return Query::select([$column]); + return Query::select($column); } /** From 01e06cf23b120b20eff6b159bc6531dd412677d8 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 23 Dec 2025 07:59:18 +0200 Subject: [PATCH 04/11] fallback query select --- src/Migration/Sources/Appwrite/Reader/API.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Migration/Sources/Appwrite/Reader/API.php b/src/Migration/Sources/Appwrite/Reader/API.php index 20141b00..d71d1060 100644 --- a/src/Migration/Sources/Appwrite/Reader/API.php +++ b/src/Migration/Sources/Appwrite/Reader/API.php @@ -210,6 +210,11 @@ public function getRow(Table $resource, string $rowId, array $queries = []): arr */ public function querySelect(string $column): string { + return new Query('select', $column); + + /** + * todo fix Query::select to get attribute not array + */ return Query::select($column); } From 6a95abb203186b5cc82e8aff6293c9a0b733dab9 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 15 Jan 2026 16:31:05 +0200 Subject: [PATCH 05/11] 4.5.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 967afcef..6bc28522 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "ext-curl": "*", "ext-openssl": "*", "appwrite/appwrite": "15.*", - "utopia-php/database": "dev-joins8 as 4.3.0", + "utopia-php/database": "dev-joins8 as 4.5.2", "utopia-php/storage": "0.18.*", "utopia-php/dsn": "0.2.*", "utopia-php/console": "0.0.*" From 53ce92c0db887eebf160d64779e02156250cb8b3 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 15 Jan 2026 16:32:37 +0200 Subject: [PATCH 06/11] pull main --- composer.lock | 77 ++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/composer.lock b/composer.lock index 8daa317f..f7aa6b07 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0879f75ea2c2090876796ffd56b8f641", + "content-hash": "340b05ddc60cf89b2496bd2817f1ab84", "packages": [ { "name": "appwrite/appwrite", @@ -187,16 +187,16 @@ }, { "name": "google/protobuf", - "version": "v4.33.2", + "version": "v4.33.4", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318" + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/22d28025cda0d223a2e48c2e16c5284ecc9f5402", + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402", "shasum": "" }, "require": { @@ -225,9 +225,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.2" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.4" }, - "time": "2025-12-05T22:12:22+00:00" + "time": "2026-01-12T17:58:43+00:00" }, { "name": "mongodb/mongodb", @@ -581,16 +581,16 @@ }, { "name": "open-telemetry/exporter-otlp", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "07b02bc71838463f6edcc78d3485c04b48fb263d" + "reference": "62e680d587beb42e5247aa6ecd89ad1ca406e8ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/07b02bc71838463f6edcc78d3485c04b48fb263d", - "reference": "07b02bc71838463f6edcc78d3485c04b48fb263d", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/62e680d587beb42e5247aa6ecd89ad1ca406e8ca", + "reference": "62e680d587beb42e5247aa6ecd89ad1ca406e8ca", "shasum": "" }, "require": { @@ -641,7 +641,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-11-13T08:04:37+00:00" + "time": "2026-01-15T09:31:34+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", @@ -2214,16 +2214,16 @@ }, { "name": "utopia-php/database", - "version": "4.3.0", + "version": "dev-joins8", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "fe7a1326ad623609e65587fe8c01a630a7075fee" + "reference": "189102c28ffc4b989c050fc85498dec0b7275bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/fe7a1326ad623609e65587fe8c01a630a7075fee", - "reference": "fe7a1326ad623609e65587fe8c01a630a7075fee", + "url": "https://api.github.com/repos/utopia-php/database/zipball/189102c28ffc4b989c050fc85498dec0b7275bbb", + "reference": "189102c28ffc4b989c050fc85498dec0b7275bbb", "shasum": "" }, "require": { @@ -2266,9 +2266,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/4.3.0" + "source": "https://github.com/utopia-php/database/tree/joins8" }, - "time": "2025-11-14T03:43:10+00:00" + "time": "2026-01-15T12:03:00+00:00" }, { "name": "utopia-php/dsn", @@ -2478,16 +2478,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.21", + "version": "0.18.22", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "cabf77fb9cce98ff3629f341cde05b88e5598f93" + "reference": "c46bd78c1f52281df89f8921159782b20260ce31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/cabf77fb9cce98ff3629f341cde05b88e5598f93", - "reference": "cabf77fb9cce98ff3629f341cde05b88e5598f93", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/c46bd78c1f52281df89f8921159782b20260ce31", + "reference": "c46bd78c1f52281df89f8921159782b20260ce31", "shasum": "" }, "require": { @@ -2530,9 +2530,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.21" + "source": "https://github.com/utopia-php/storage/tree/0.18.22" }, - "time": "2026-01-01T19:12:11+00:00" + "time": "2026-01-15T01:36:39+00:00" }, { "name": "utopia-php/system", @@ -3522,16 +3522,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.46", + "version": "11.5.47", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "75dfe79a2aa30085b7132bb84377c24062193f33" + "reference": "a8c3c540923f8a3d499659b927228059bb3809d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/75dfe79a2aa30085b7132bb84377c24062193f33", - "reference": "75dfe79a2aa30085b7132bb84377c24062193f33", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a8c3c540923f8a3d499659b927228059bb3809d8", + "reference": "a8c3c540923f8a3d499659b927228059bb3809d8", "shasum": "" }, "require": { @@ -3545,7 +3545,7 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.11", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", @@ -3603,7 +3603,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.46" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.47" }, "funding": [ { @@ -3627,7 +3627,7 @@ "type": "tidelift" } ], - "time": "2025-12-06T08:01:15+00:00" + "time": "2026-01-15T12:00:46+00:00" }, { "name": "sebastian/cli-parser", @@ -4969,9 +4969,18 @@ "time": "2025-12-27T19:49:13+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-joins8", + "alias": "4.5.2", + "alias_normalized": "4.5.2.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -4982,5 +4991,5 @@ "platform-dev": { "ext-pdo": "*" }, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.6.0" } From 69ade1c74ab82eed38ec7c47abc5fdf0ba6395e3 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 18 Jan 2026 08:55:32 +0200 Subject: [PATCH 07/11] Update lock --- composer.lock | 63 +++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/composer.lock b/composer.lock index fb29c8a9..b8dab1a4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cf3cc5c8ea77349cef37794a3a47f45e", + "content-hash": "340b05ddc60cf89b2496bd2817f1ab84", "packages": [ { "name": "appwrite/appwrite", @@ -708,16 +708,16 @@ }, { "name": "open-telemetry/sdk", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "3dfc3d1ad729ec7eb25f1b9a4ae39fe779affa99" + "reference": "d91f21addcdb42da9a451c002777f8318432461a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/3dfc3d1ad729ec7eb25f1b9a4ae39fe779affa99", - "reference": "3dfc3d1ad729ec7eb25f1b9a4ae39fe779affa99", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/d91f21addcdb42da9a451c002777f8318432461a", + "reference": "d91f21addcdb42da9a451c002777f8318432461a", "shasum": "" }, "require": { @@ -801,7 +801,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-11-25T10:59:15+00:00" + "time": "2026-01-15T11:21:03+00:00" }, { "name": "open-telemetry/sem-conv", @@ -2214,16 +2214,16 @@ }, { "name": "utopia-php/database", - "version": "4.5.3", + "version": "dev-joins8", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "78f7c97e12872b206c4ee6bc8cdc342654b7568c" + "reference": "863b47f714d18d8d16b883bef75c030c385ec2e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/78f7c97e12872b206c4ee6bc8cdc342654b7568c", - "reference": "78f7c97e12872b206c4ee6bc8cdc342654b7568c", + "url": "https://api.github.com/repos/utopia-php/database/zipball/863b47f714d18d8d16b883bef75c030c385ec2e4", + "reference": "863b47f714d18d8d16b883bef75c030c385ec2e4", "shasum": "" }, "require": { @@ -2266,9 +2266,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/4.5.3" + "source": "https://github.com/utopia-php/database/tree/joins8" }, - "time": "2026-01-16T08:45:47+00:00" + "time": "2026-01-18T06:53:54+00:00" }, { "name": "utopia-php/dsn", @@ -2479,16 +2479,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.21", + "version": "0.18.22", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "cabf77fb9cce98ff3629f341cde05b88e5598f93" + "reference": "c46bd78c1f52281df89f8921159782b20260ce31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/cabf77fb9cce98ff3629f341cde05b88e5598f93", - "reference": "cabf77fb9cce98ff3629f341cde05b88e5598f93", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/c46bd78c1f52281df89f8921159782b20260ce31", + "reference": "c46bd78c1f52281df89f8921159782b20260ce31", "shasum": "" }, "require": { @@ -2531,9 +2531,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.21" + "source": "https://github.com/utopia-php/storage/tree/0.18.22" }, - "time": "2026-01-01T19:12:11+00:00" + "time": "2026-01-15T01:36:39+00:00" }, { "name": "utopia-php/system", @@ -3523,16 +3523,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.46", + "version": "11.5.48", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "75dfe79a2aa30085b7132bb84377c24062193f33" + "reference": "fe3665c15e37140f55aaf658c81a2eb9030b6d89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/75dfe79a2aa30085b7132bb84377c24062193f33", - "reference": "75dfe79a2aa30085b7132bb84377c24062193f33", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fe3665c15e37140f55aaf658c81a2eb9030b6d89", + "reference": "fe3665c15e37140f55aaf658c81a2eb9030b6d89", "shasum": "" }, "require": { @@ -3546,7 +3546,7 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.11", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", @@ -3604,7 +3604,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.46" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.48" }, "funding": [ { @@ -3628,7 +3628,7 @@ "type": "tidelift" } ], - "time": "2025-12-06T08:01:15+00:00" + "time": "2026-01-16T16:26:27+00:00" }, { "name": "sebastian/cli-parser", @@ -4970,9 +4970,18 @@ "time": "2025-12-27T19:49:13+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-joins8", + "alias": "4.5.2", + "alias_normalized": "4.5.2.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From 066bd70edf19d36e4afa30972f2fbab8ecf63a6c Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 18 Jan 2026 09:21:06 +0200 Subject: [PATCH 08/11] lock --- composer.json | 2 +- composer.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 0797f4a9..0576412d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "ext-curl": "*", "ext-openssl": "*", "appwrite/appwrite": "19.*", - "utopia-php/database": "dev-joins8 as 4.5.2", + "utopia-php/database": "dev-joins8 as 4.6.0", "utopia-php/storage": "0.18.*", "utopia-php/dsn": "0.2.*", "utopia-php/console": "0.0.*" diff --git a/composer.lock b/composer.lock index b8dab1a4..f278e725 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "340b05ddc60cf89b2496bd2817f1ab84", + "content-hash": "6b7dec5ccd51e4f38a1ccb124e6f35b9", "packages": [ { "name": "appwrite/appwrite", @@ -4974,8 +4974,8 @@ { "package": "utopia-php/database", "version": "dev-joins8", - "alias": "4.5.2", - "alias_normalized": "4.5.2.0" + "alias": "4.6.0", + "alias_normalized": "4.6.0.0" } ], "minimum-stability": "stable", From 49bddeb2a9a259586ef186d75c9d942ee8e53104 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 18 Jan 2026 10:22:09 +0200 Subject: [PATCH 09/11] database 4.5.2 --- composer.json | 2 +- composer.lock | 45 ++++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 0576412d..0c6333e3 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "ext-curl": "*", "ext-openssl": "*", "appwrite/appwrite": "19.*", - "utopia-php/database": "dev-joins8 as 4.6.0", + "utopia-php/database": "dev-joins8 as 4.5.2", "utopia-php/storage": "0.18.*", "utopia-php/dsn": "0.2.*", "utopia-php/console": "0.0.*" diff --git a/composer.lock b/composer.lock index f278e725..82eb6573 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6b7dec5ccd51e4f38a1ccb124e6f35b9", + "content-hash": "340b05ddc60cf89b2496bd2817f1ab84", "packages": [ { "name": "appwrite/appwrite", @@ -2068,16 +2068,16 @@ }, { "name": "utopia-php/cache", - "version": "0.13.3", + "version": "0.13.2", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "355707ab2c0090435059216165db86976b68a126" + "reference": "5768498c9f451482f0bf3eede4d6452ddcd4a0f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/355707ab2c0090435059216165db86976b68a126", - "reference": "355707ab2c0090435059216165db86976b68a126", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/5768498c9f451482f0bf3eede4d6452ddcd4a0f6", + "reference": "5768498c9f451482f0bf3eede4d6452ddcd4a0f6", "shasum": "" }, "require": { @@ -2085,7 +2085,7 @@ "ext-memcached": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/pools": "1.*", + "utopia-php/pools": "0.8.*", "utopia-php/telemetry": "*" }, "require-dev": { @@ -2114,9 +2114,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.13.3" + "source": "https://github.com/utopia-php/cache/tree/0.13.2" }, - "time": "2026-01-16T07:54:34+00:00" + "time": "2025-12-17T08:55:43+00:00" }, { "name": "utopia-php/compression", @@ -2218,12 +2218,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "863b47f714d18d8d16b883bef75c030c385ec2e4" + "reference": "8d35f5cbfda7496d136a73cae45ff87c54536ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/863b47f714d18d8d16b883bef75c030c385ec2e4", - "reference": "863b47f714d18d8d16b883bef75c030c385ec2e4", + "url": "https://api.github.com/repos/utopia-php/database/zipball/8d35f5cbfda7496d136a73cae45ff87c54536ec3", + "reference": "8d35f5cbfda7496d136a73cae45ff87c54536ec3", "shasum": "" }, "require": { @@ -2234,7 +2234,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/framework": "0.33.*", "utopia-php/mongo": "0.11.*", - "utopia-php/pools": "1.*" + "utopia-php/pools": "0.8.*" }, "require-dev": { "fakerphp/faker": "1.23.*", @@ -2268,7 +2268,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/joins8" }, - "time": "2026-01-18T06:53:54+00:00" + "time": "2026-01-18T08:00:42+00:00" }, { "name": "utopia-php/dsn", @@ -2426,16 +2426,16 @@ }, { "name": "utopia-php/pools", - "version": "1.0.0", + "version": "0.8.3", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "74ba7dc985c2f629df8cf08ed95507955e3bcf86" + "reference": "ad7d6ba946376e81c603204285ce9a674b6502b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/74ba7dc985c2f629df8cf08ed95507955e3bcf86", - "reference": "74ba7dc985c2f629df8cf08ed95507955e3bcf86", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/ad7d6ba946376e81c603204285ce9a674b6502b8", + "reference": "ad7d6ba946376e81c603204285ce9a674b6502b8", "shasum": "" }, "require": { @@ -2445,8 +2445,7 @@ "require-dev": { "laravel/pint": "1.*", "phpstan/phpstan": "1.*", - "phpunit/phpunit": "11.*", - "swoole/ide-helper": "5.1.2" + "phpunit/phpunit": "11.*" }, "type": "library", "autoload": { @@ -2473,9 +2472,9 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/1.0.0" + "source": "https://github.com/utopia-php/pools/tree/0.8.3" }, - "time": "2026-01-15T12:34:17+00:00" + "time": "2025-12-17T09:35:18+00:00" }, { "name": "utopia-php/storage", @@ -4974,8 +4973,8 @@ { "package": "utopia-php/database", "version": "dev-joins8", - "alias": "4.6.0", - "alias_normalized": "4.6.0.0" + "alias": "4.5.2", + "alias_normalized": "4.5.2.0" } ], "minimum-stability": "stable", From f50c5ad886c629f141891ee63a80bcbafab771ff Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 18 Jan 2026 15:24:26 +0200 Subject: [PATCH 10/11] fix many2many --- src/Migration/Sources/Appwrite.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index f3bf415d..58a123fd 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -1119,6 +1119,11 @@ private function exportRows(int $batchSize): void } $selects = ['*', '$id', '$permissions', '$updatedAt', '$createdAt']; // We want relations flat! + + foreach ($selects as $select) { + $queries[] = $this->database->querySelect($select); + } + $manyToMany = []; $attributes = $this->cache->get(Column::getName()); @@ -1142,24 +1147,22 @@ private function exportRows(int $batchSize): void } /** @var Column|Relationship $attribute */ - foreach ($selects as $select) { - $queries[] = $this->database->querySelect($select); - } - $response = $this->database->listRows($table, $queries); foreach ($response as $row) { // HACK: Handle many to many if (!empty($manyToMany)) { - $stack = ['$id']; // Adding $id because we can't select only relations + $queries = []; + $queries[] = $this->database->querySelect('$id'); // Adding $id because we can't select only relations + foreach ($manyToMany as $relation) { - $stack[] = $relation . '.$id'; + $queries = $this->database->querySelect($relation . '.$id'); } $rowItem = $this->database->getRow( $table, $row['$id'], - [$this->database->querySelect($stack)] + $queries ); foreach ($manyToMany as $key) { From 805bdb87e3ea8c85c58fc16dc7b56a497da161cf Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 18 Jan 2026 15:47:36 +0200 Subject: [PATCH 11/11] append queries --- src/Migration/Sources/Appwrite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index 58a123fd..f0c722fb 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -1156,7 +1156,7 @@ private function exportRows(int $batchSize): void $queries[] = $this->database->querySelect('$id'); // Adding $id because we can't select only relations foreach ($manyToMany as $relation) { - $queries = $this->database->querySelect($relation . '.$id'); + $queries[] = $this->database->querySelect($relation . '.$id'); } $rowItem = $this->database->getRow(