Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5f637cb
feat: add support for TTL indexes in database adapters and validation
ArnabChatterjee20k Jan 9, 2026
321a4c5
refactor: standardize method formatting and improve TTL index validat…
ArnabChatterjee20k Jan 12, 2026
151703f
updated adapters with the support method for the ttl index support
ArnabChatterjee20k Jan 12, 2026
cc63ade
fix: update TTL index validation messages and conditions for shared t…
ArnabChatterjee20k Jan 12, 2026
ed322e6
typo
ArnabChatterjee20k Jan 12, 2026
8fa2454
added ttl index in the missing index message
ArnabChatterjee20k Jan 12, 2026
07ccad8
Refactor SchemalessTests to improve datetime handling and add new tests
ArnabChatterjee20k Jan 13, 2026
9a21ce2
Update src/Database/Validator/Index.php
ArnabChatterjee20k Jan 13, 2026
6fd965d
fix: update TTL index default value to 1 and adjust related methods f…
ArnabChatterjee20k Jan 13, 2026
8e4e208
Merge remote-tracking branch 'upstream/mongo-ttl' into mongo-ttl
ArnabChatterjee20k Jan 13, 2026
affc6a1
test: implement retry logic for TTL expiration checks in SchemalessTests
ArnabChatterjee20k Jan 13, 2026
3cbc6f6
linting
ArnabChatterjee20k Jan 13, 2026
41ea5ca
updated waiting in ttl test
ArnabChatterjee20k Jan 13, 2026
06e8d08
updated expiry tests
ArnabChatterjee20k Jan 13, 2026
4cb6863
enforced one ttl index per collection
ArnabChatterjee20k Jan 14, 2026
cc7fca3
removed empty orders from the ttl index validator
ArnabChatterjee20k Jan 14, 2026
3b388c8
changed ttl check
ArnabChatterjee20k Jan 14, 2026
e90b89d
updated ttl attribute support in the get document
ArnabChatterjee20k Jan 22, 2026
d641084
Merge remote-tracking branch 'upstream/main' into mongo-ttl
ArnabChatterjee20k Jan 22, 2026
92aeef9
linting
ArnabChatterjee20k Jan 22, 2026
68beab1
updated composer
ArnabChatterjee20k Jan 22, 2026
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"ext-mbstring": "*",
"utopia-php/framework": "0.33.*",
"utopia-php/cache": "0.13.*",
"utopia-php/pools": "0.8.*",
"utopia-php/pools": "1.*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find Pool-related imports and usages in the codebase

echo "=== Pool imports ==="
rg -n --type php 'use Utopia\\Pools' --glob '!vendor/*'

echo ""
echo "=== Pool class instantiation ==="
rg -n --type php 'new Pool\|->pool\|Pool::' --glob '!vendor/*' -C2

echo ""
echo "=== Mirror adapter usage ==="
rg -n --type php 'Mirror' --glob '!vendor/*' -C2 | head -50

Repository: utopia-php/database

Length of output: 3223


🌐 Web query:

utopia-php/pools 1.0 release changelog breaking changes

💡 Result:

I couldn't find a utopia-php/pools v1.0 release or a 1.0 changelog. The latest released tag listed on Packagist is v0.8.2 (last updated Sep 26, 2025). [1]

If you want, I can check the GitHub releases/tags page or repository commit history for any unpublished v1.0 notes—shall I do that?

Sources:


🏁 Script executed:

#!/bin/bash
# Check Pool adapter implementation and composer.json context

echo "=== Pool adapter implementation ==="
head -50 src/Database/Adapter/Pool.php

echo ""
echo "=== Full composer.json for context ==="
cat composer.json | grep -A5 -B5 'utopia-php/pools'

echo ""
echo "=== Check for repositories/VCS config in composer.json ==="
rg -n '"repositories"|"require-dev"|"utopia-php/pools"' composer.json -C2

Repository: utopia-php/database

Length of output: 2404


🌐 Web query:

utopia-php/pools repository github tags releases dev-master 1.0

💡 Result:

The utopia-php/pools package's latest released version on Packagist is 0.8.2 (no 1.0 release listed). Packagist/Libraries.io show current published versions (no 1.0). [1][2]

If you need the repository's branch names (e.g., dev-master) or Git tags directly, check the GitHub repo tags/releases page (github.com/utopia-php/pools) — Packagist reflects published Composer versions. [1][2]

Sources:

  • Packagist package page for utopia-php/pools. [1]
  • Libraries.io / Packagist mirror for utopia-php/pools. [2]

🏁 Script executed:

#!/bin/bash
# Check complete composer.json structure for any special configurations

echo "=== Entire composer.json ==="
cat composer.json

echo ""
echo "=== Check git references to pools library ==="
rg 'pools' .gitmodules 2>/dev/null || echo "No git submodules found"

Repository: utopia-php/database

Length of output: 2369


🌐 Web query:

utopia-php/pools GitHub repository tags releases main dev-main

💡 Result:

Summary I found on the package registry:

  • Latest published tag/release: 0.8.2 (tagged 2025-04-17) for utopia-php/pools. [1]

The package source is on GitHub (github.com/utopia-php/pools). Would you like me to open the GitHub repo now and list its tags/releases and branches (main, dev-main) directly?


Fix invalid dependency constraint for utopia-php/pools.

The version 1.* does not exist on Packagist or in any public repository. The latest available release is 0.8.2. This constraint will cause composer install to fail.

Either correct the version to 0.8.* if the code is compatible with the current release, or verify this PR should only be merged after utopia-php/pools v1.0 is officially released.

🤖 Prompt for AI Agents
In `@composer.json` at line 42, The composer.json dependency "utopia-php/pools":
"1.*" is invalid; update the constraint to a real published version (for example
change "utopia-php/pools": "0.8.*") if the code is compatible, or revert this
change and ensure the PR is held until utopia-php/pools v1.0 is officially
released; modify the dependency string in composer.json accordingly and run
composer validate/install to confirm the fix.

"utopia-php/mongo": "0.11.*"
},
"require-dev": {
Expand Down
33 changes: 17 additions & 16 deletions composer.lock

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

14 changes: 13 additions & 1 deletion src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,12 @@ abstract public function renameIndex(string $collection, string $old, string $ne
* @param array<int> $lengths
* @param array<string> $orders
* @param array<string,string> $indexAttributeTypes
* @param array<string, mixed> $collation
* @param int $ttl
*
* @return bool
*/
abstract public function createIndex(string $collection, string $id, string $type, array $attributes, array $lengths, array $orders, array $indexAttributeTypes = []): bool;
abstract public function createIndex(string $collection, string $id, string $type, array $attributes, array $lengths, array $orders, array $indexAttributeTypes = [], array $collation = [], int $ttl = 1): bool;

/**
* Delete Index
Expand Down Expand Up @@ -1519,4 +1521,14 @@ public function getSupportForRegex(): bool
{
return $this->getSupportForPCRERegex() || $this->getSupportForPOSIXRegex();
}

/**
* Are ttl indexes supported?
*
* @return bool
*/
public function getSupportForTTLIndexes(): bool
{
return false;
}
}
7 changes: 6 additions & 1 deletion src/Database/Adapter/MariaDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public function renameIndex(string $collection, string $old, string $new): bool
* @return bool
* @throws DatabaseException
*/
public function createIndex(string $collection, string $id, string $type, array $attributes, array $lengths, array $orders, array $indexAttributeTypes = []): bool
public function createIndex(string $collection, string $id, string $type, array $attributes, array $lengths, array $orders, array $indexAttributeTypes = [], array $collation = [], int $ttl = 1): bool
{
$metadataCollection = new Document(['$id' => Database::METADATA]);
$collection = $this->getDocument($metadataCollection, $collection);
Expand Down Expand Up @@ -2283,4 +2283,9 @@ public function getSupportForPOSIXRegex(): bool
{
return false;
}

public function getSupportForTTLIndexes(): bool
{
return false;
}
}
Loading
Loading