mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge pull request #108 from utopia-php/chore-update-database
This commit is contained in:
3 files changed
+45
-47
No files matched your search
+2
-2
@@ -22,8 +22,8 @@
|
||||
"ext-pdo": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-redis": "*",
|
||||
"utopia-php/database": "3.*.*",
|
||||
"appwrite/appwrite": "19.*.*"
|
||||
"utopia-php/database": "4.*",
|
||||
"appwrite/appwrite": "19.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "9.*",
|
||||
|
||||
Generated
+38
-39
@@ -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": "77897ae78f63709875ab922685547528",
|
||||
"content-hash": "fca63c0aef58e61245c71a861b7169ae",
|
||||
"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",
|
||||
@@ -2166,16 +2166,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "3.6.1",
|
||||
"version": "4.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7"
|
||||
"reference": "7b935bb09aeae8aeff5a28f6f2485cef1cc4d898"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/c8c1b2f5770245dd4006e2680681e3efbe8b1fa7",
|
||||
"reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/7b935bb09aeae8aeff5a28f6f2485cef1cc4d898",
|
||||
"reference": "7b935bb09aeae8aeff5a28f6f2485cef1cc4d898",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2218,29 +2218,29 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/3.6.1"
|
||||
"source": "https://github.com/utopia-php/database/tree/4.5.1"
|
||||
},
|
||||
"time": "2025-12-16T09:55:41+00:00"
|
||||
"time": "2026-01-14T12:07:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/framework",
|
||||
"version": "0.33.35",
|
||||
"version": "0.33.37",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/http.git",
|
||||
"reference": "82b139fb04f30045db51b0d322224f222da32313"
|
||||
"reference": "30a119d76531d89da9240496940c84fcd9e1758b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/http/zipball/82b139fb04f30045db51b0d322224f222da32313",
|
||||
"reference": "82b139fb04f30045db51b0d322224f222da32313",
|
||||
"url": "https://api.github.com/repos/utopia-php/http/zipball/30a119d76531d89da9240496940c84fcd9e1758b",
|
||||
"reference": "30a119d76531d89da9240496940c84fcd9e1758b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.3",
|
||||
"utopia-php/compression": "0.1.*",
|
||||
"utopia-php/telemetry": "0.1.*",
|
||||
"utopia-php/validators": "0.1.*"
|
||||
"utopia-php/validators": "0.2.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "1.*",
|
||||
@@ -2266,9 +2266,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/http/issues",
|
||||
"source": "https://github.com/utopia-php/http/tree/0.33.35"
|
||||
"source": "https://github.com/utopia-php/http/tree/0.33.37"
|
||||
},
|
||||
"time": "2025-12-12T08:33:52+00:00"
|
||||
"time": "2026-01-13T10:10:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/mongo",
|
||||
@@ -2435,16 +2435,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/validators",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/validators.git",
|
||||
"reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080"
|
||||
"reference": "30b6030a5b100fc1dff34506e5053759594b2a20"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/validators/zipball/5c57d5b6cf964f8981807c1d3ea8df620c869080",
|
||||
"reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080",
|
||||
"url": "https://api.github.com/repos/utopia-php/validators/zipball/30b6030a5b100fc1dff34506e5053759594b2a20",
|
||||
"reference": "30b6030a5b100fc1dff34506e5053759594b2a20",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2452,7 +2452,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "1.*",
|
||||
"phpstan/phpstan": "1.*",
|
||||
"phpstan/phpstan": "2.*",
|
||||
"phpunit/phpunit": "11.*"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -2474,9 +2474,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/validators/issues",
|
||||
"source": "https://github.com/utopia-php/validators/tree/0.1.0"
|
||||
"source": "https://github.com/utopia-php/validators/tree/0.2.0"
|
||||
},
|
||||
"time": "2025-11-18T11:05:46+00:00"
|
||||
"time": "2026-01-13T09:16:51+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@@ -2559,30 +2559,29 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/instantiator.git",
|
||||
"reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
|
||||
"reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
|
||||
"reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/23da848e1a2308728fe5fdddabf4be17ff9720c7",
|
||||
"reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.1"
|
||||
"php": "^8.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^11",
|
||||
"doctrine/coding-standard": "^14",
|
||||
"ext-pdo": "*",
|
||||
"ext-phar": "*",
|
||||
"phpbench/phpbench": "^1.2",
|
||||
"phpstan/phpstan": "^1.9.4",
|
||||
"phpstan/phpstan-phpunit": "^1.3",
|
||||
"phpunit/phpunit": "^9.5.27",
|
||||
"vimeo/psalm": "^5.4"
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"phpstan/phpstan-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^10.5.58"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -2609,7 +2608,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/instantiator/issues",
|
||||
"source": "https://github.com/doctrine/instantiator/tree/2.0.0"
|
||||
"source": "https://github.com/doctrine/instantiator/tree/2.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2625,7 +2624,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-12-30T00:23:10+00:00"
|
||||
"time": "2026-01-05T06:47:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
|
||||
@@ -10,7 +10,6 @@ use Utopia\Database\Exception\Authorization as AuthorizationException;
|
||||
use Utopia\Database\Exception\Duplicate;
|
||||
use Utopia\Database\Exception\Structure;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\Exception;
|
||||
|
||||
class Database extends TimeLimit
|
||||
@@ -139,7 +138,7 @@ class Database extends TimeLimit
|
||||
$timestamp = $this->toDateTime($timestamp);
|
||||
|
||||
/** @var array<Document> $result */
|
||||
$result = Authorization::skip(function () use ($key, $timestamp) {
|
||||
$result = $this->db->getAuthorization()->skip(function () use ($key, $timestamp) {
|
||||
return $this->db->find(self::COLLECTION, [
|
||||
Query::equal('key', [$key]),
|
||||
Query::equal('time', [$timestamp]),
|
||||
@@ -172,7 +171,7 @@ class Database extends TimeLimit
|
||||
}
|
||||
|
||||
$timestamp = $this->toDateTime($timestamp);
|
||||
Authorization::skip(function () use ($timestamp, $key) {
|
||||
$this->db->getAuthorization()->skip(function () use ($timestamp, $key) {
|
||||
$data = $this->db->findOne(self::COLLECTION, [
|
||||
Query::equal('key', [$key]),
|
||||
Query::equal('time', [$timestamp]),
|
||||
@@ -226,7 +225,7 @@ class Database extends TimeLimit
|
||||
protected function set(string $key, int $timestamp, int $value): void
|
||||
{
|
||||
$timestamp = $this->toDateTime($timestamp);
|
||||
Authorization::skip(function () use ($timestamp, $key, $value) {
|
||||
$this->db->getAuthorization()->skip(function () use ($timestamp, $key, $value) {
|
||||
$data = $this->db->findOne(self::COLLECTION, [
|
||||
Query::equal('key', [$key]),
|
||||
Query::equal('time', [$timestamp]),
|
||||
@@ -284,7 +283,7 @@ class Database extends TimeLimit
|
||||
public function getLogs(?int $offset = null, ?int $limit = 25): array
|
||||
{
|
||||
/** @var array<Document> $results */
|
||||
$results = Authorization::skip(function () use ($offset, $limit) {
|
||||
$results = $this->db->getAuthorization()->skip(function () use ($offset, $limit) {
|
||||
$queries = [];
|
||||
$queries[] = Query::orderDesc('');
|
||||
|
||||
@@ -312,7 +311,7 @@ class Database extends TimeLimit
|
||||
public function cleanup(int $timestamp): bool
|
||||
{
|
||||
$timestamp = $this->toDateTime($timestamp);
|
||||
Authorization::skip(function () use ($timestamp) {
|
||||
$this->db->getAuthorization()->skip(function () use ($timestamp) {
|
||||
do {
|
||||
$documents = $this->db->find(self::COLLECTION, [
|
||||
Query::lessThan('time', $timestamp),
|
||||
|
||||
Reference in new issue
Block a user