Skip to content

Commit 6f0bc59

Browse files
authored
Merge pull request #783 from utopia-php/chore-sync-3.x
2 parents 783193d + d220e17 commit 6f0bc59

24 files changed

+2595
-243
lines changed

bin/tasks/operators.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Utopia\Database\Operator;
3333
use Utopia\Database\PDO;
3434
use Utopia\Database\Query;
35-
use Utopia\Database\Validator\Authorization;
3635
use Utopia\Validator\Integer;
3736
use Utopia\Validator\Text;
3837

@@ -148,7 +147,7 @@ function setupTestEnvironment(Database $database, string $name, int $seed): void
148147
}
149148
$database->create();
150149

151-
Authorization::setRole(Role::any()->toString());
150+
$authorization->addRole(Role::any()->toString());
152151

153152
// Create test collection
154153
$database->createCollection('operators_test', permissions: [

composer.lock

Lines changed: 184 additions & 138 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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,13 @@ abstract public function getSupportForSpatialAttributes(): bool;
11011101
*/
11021102
abstract public function getSupportForObject(): bool;
11031103

1104+
/**
1105+
* Are object (JSON) indexes supported?
1106+
*
1107+
* @return bool
1108+
*/
1109+
abstract public function getSupportForObjectIndexes(): bool;
1110+
11041111
/**
11051112
* Does the adapter support null values in spatial indexes?
11061113
*
@@ -1471,4 +1478,38 @@ public function enableAlterLocks(bool $enable): self
14711478
* @return bool
14721479
*/
14731480
abstract public function getSupportNonUtfCharacters(): bool;
1481+
1482+
/**
1483+
* Does the adapter support trigram index?
1484+
*
1485+
* @return bool
1486+
*/
1487+
abstract public function getSupportForTrigramIndex(): bool;
1488+
1489+
/**
1490+
* Is PCRE regex supported?
1491+
* PCRE (Perl Compatible Regular Expressions) supports \b for word boundaries
1492+
*
1493+
* @return bool
1494+
*/
1495+
abstract public function getSupportForPCRERegex(): bool;
1496+
1497+
/**
1498+
* Is POSIX regex supported?
1499+
* POSIX regex uses \y for word boundaries instead of \b
1500+
*
1501+
* @return bool
1502+
*/
1503+
abstract public function getSupportForPOSIXRegex(): bool;
1504+
1505+
/**
1506+
* Is regex supported at all?
1507+
* Returns true if either PCRE or POSIX regex is supported
1508+
*
1509+
* @return bool
1510+
*/
1511+
public function getSupportForRegex(): bool
1512+
{
1513+
return $this->getSupportForPCRERegex() || $this->getSupportForPOSIXRegex();
1514+
}
14741515
}

src/Database/Adapter/MariaDB.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,16 @@ public function getSupportForObject(): bool
21452145
return false;
21462146
}
21472147

2148+
/**
2149+
* Are object (JSON) indexes supported?
2150+
*
2151+
* @return bool
2152+
*/
2153+
public function getSupportForObjectIndexes(): bool
2154+
{
2155+
return false;
2156+
}
2157+
21482158
/**
21492159
* Get Support for Null Values in Spatial Indexes
21502160
*
@@ -2240,4 +2250,19 @@ public function getSupportNonUtfCharacters(): bool
22402250
{
22412251
return true;
22422252
}
2253+
2254+
public function getSupportForTrigramIndex(): bool
2255+
{
2256+
return false;
2257+
}
2258+
2259+
public function getSupportForPCRERegex(): bool
2260+
{
2261+
return true;
2262+
}
2263+
2264+
public function getSupportForPOSIXRegex(): bool
2265+
{
2266+
return false;
2267+
}
22432268
}

0 commit comments

Comments
 (0)