-
Notifications
You must be signed in to change notification settings - Fork 21
Upgrade utopia-php/database to 5.* #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request updates the utopia-php/database dependency version constraint in composer.json from 4.* to 5.*. This is a single-line modification that changes the major version requirement for this dependency. No other files are affected, and no functional code changes are present in this diff. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@composer.json`:
- Line 25: The composer.json change upgrades "utopia-php/database" to "5.*" but
the package still declares "php": ">=8.0", causing an incompatibility because
Database v5 requires PHP >=8.4; either update the "php" requirement in
composer.json to ">=8.4" (and ensure all consumers can upgrade) or revert the
"utopia-php/database" version back to "4.*" to preserve PHP 8.0–8.3
support—locate the "utopia-php/database" entry and the top-level "php"
constraint in composer.json and make the corresponding change consistently.
| "ext-curl": "*", | ||
| "ext-redis": "*", | ||
| "utopia-php/database": "4.*", | ||
| "utopia-php/database": "5.*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find usage of utopia-php/database classes in the source code
echo "=== Searching for Database namespace imports ==="
rg -n "use Utopia\\Database" src/ 2>/dev/null || echo "No Database imports found in src/"
echo ""
echo "=== Searching for Database-related class instantiations ==="
rg -n "new\s+Database" src/ 2>/dev/null || echo "No Database instantiations found"
echo ""
echo "=== Searching for any Utopia namespace usage ==="
rg -n "use Utopia" src/ 2>/dev/null | head -20
echo ""
echo "=== Checking composer.json for other database-related dependencies ==="
cat composer.json | grep -i databaseRepository: utopia-php/abuse
Length of output: 1673
🌐 Web query:
utopia-php/database version 5 release breaking changes migration guide
💡 Result:
utopia-php/database v5.0.0 (released Jan 30, 2026) — breaking changes & migration notes
Breaking changes
- Minimum PHP is now
>= 8.4(was>= 8.1in v4). (github.com) - Dependency major bumps:
utopia-php/cache0.13.* → 1.0.*utopia-php/pools0.8.* → 1.0.* (github.com)
- Pools v1 constructor change impacts users of the pool helper used by this library/tests: pool initialization now requires an adapter parameter. (github.com)
Migration guide (practical steps)
-
Update your platform requirement
- Ensure your runtime and CI use PHP 8.4+. (packagist.org)
-
Update composer constraints
- Bump to v5:
utopia-php/database: ^5.0
- If you pin related packages, ensure:
utopia-php/cache: ^1.0utopia-php/pools: ^1.0(packagist.org)
- Bump to v5:
-
Fix pool instantiation (if you use pools directly / via helpers)
- Update code that constructs pools to pass an adapter first (example shown in the v5 upgrade PR notes/tests). (github.com)
Release notes reference
- The upstream v5.0.0 GitHub release notes list the change as upgrading the cache dependency (for reconnection support). (github.com)
Citations:
- 1: https://github.com/utopia-php/database/pull/797/files
- 2: https://github.com/utopia-php/database/pull/797/files
- 3: Upgrade cache dependency for reconnection support database#797
- 4: https://packagist.org/packages/utopia-php/database
- 5: https://packagist.org/packages/utopia-php/database
- 6: Upgrade cache dependency for reconnection support database#797
- 7: https://github.com/utopia-php/database/releases/tag/5.0.0
🏁 Script executed:
#!/bin/bash
# Check PHP version requirement
echo "=== PHP version requirement in composer.json ==="
rg -A 2 '"php"' composer.json
echo ""
echo "=== TimeLimit/Database.php file size ==="
wc -l src/Abuse/Adapters/TimeLimit/Database.php
echo ""
echo "=== TimeLimit/Database.php - first 60 lines ==="
head -60 src/Abuse/Adapters/TimeLimit/Database.phpRepository: utopia-php/abuse
Length of output: 2100
🏁 Script executed:
#!/bin/bash
# Check rest of Database.php to see actual usage patterns
echo "=== TimeLimit/Database.php - lines 60-150 ==="
sed -n '60,150p' src/Abuse/Adapters/TimeLimit/Database.php
echo ""
echo "=== Check if pools is in dependencies ==="
rg -i "pool" composer.json
echo ""
echo "=== Check for any pool usage in codebase ==="
rg -n "pool" src/ tests/ 2>/dev/null | head -20Repository: utopia-php/abuse
Length of output: 2479
🏁 Script executed:
#!/bin/bash
# Check the rest of Database.php for more API usage
echo "=== TimeLimit/Database.php - lines 150-250 ==="
sed -n '150,250p' src/Abuse/Adapters/TimeLimit/Database.php
echo ""
echo "=== Check full composer.json ==="
cat composer.jsonRepository: utopia-php/abuse
Length of output: 4945
PHP version requirement incompatibility blocks this upgrade.
Upgrading utopia-php/database to 5.* requires PHP >= 8.4, but this library declares "php": ">=8.0" in composer.json. Database v5 cannot run on PHP 8.0–8.3.
Before proceeding with this upgrade:
- Update the PHP version requirement in composer.json to
">=8.4", or - Revert to database
4.*and find another path to satisfy the appwrite/appwrite dependency constraint.
If updating PHP requirement, also verify that all consumers of this library can upgrade to PHP 8.4+.
🤖 Prompt for AI Agents
In `@composer.json` at line 25, The composer.json change upgrades
"utopia-php/database" to "5.*" but the package still declares "php": ">=8.0",
causing an incompatibility because Database v5 requires PHP >=8.4; either update
the "php" requirement in composer.json to ">=8.4" (and ensure all consumers can
upgrade) or revert the "utopia-php/database" version back to "4.*" to preserve
PHP 8.0–8.3 support—locate the "utopia-php/database" entry and the top-level
"php" constraint in composer.json and make the corresponding change
consistently.
Summary
This upgrade is required for compatibility with appwrite/appwrite which is upgrading to utopia-php/cache 1.0.* (which depends on database 5.*).
Related PRs
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.