-
Notifications
You must be signed in to change notification settings - Fork 9
Upgrade database to 5.* #107
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 Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 31: Update composer.json PHP platform requirement from ">=8.0" to ">=8.4"
and ensure the dependency "utopia-php/database": "5.*" is intended; then audit
and update any code that initializes database adapters and cache/pool usage to
be compatible with the new cache 1.0.* and pools 1.0.* major bumps—focus on
constructors/factory calls used in your database adapter initialization code
(search for Database client, Query, Document instantiations and adapter
initialization functions) and review all cache operations (get/set/pool
creation) for API changes; run composer update and unit/integration tests to
catch breakages and adjust call signatures where Document, Query, or Database
client usage no longer match the new 5.x API.
| "require": { | ||
| "php": ">=8.0", | ||
| "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
# Check how utopia-php/database is used in this library
echo "=== Files using Database namespace ==="
rg -l "Utopia.*Database" --type php
echo ""
echo "=== Database use statements ==="
rg -n "use Utopia\\\\Database" --type php
echo ""
echo "=== Database method/property calls ==="
rg -n '\$database->' --type php -C 1 | head -50
echo ""
echo "=== Database parameter type hints ==="
rg -n "Database\s*\$" --type php
echo ""
echo "=== Document class usage ==="
rg -n "\\bDocument\\b" --type php | head -20Repository: utopia-php/audit
Length of output: 2835
🌐 Web query:
utopia-php/database 5.0 release notes breaking changes migration
💡 Result:
utopia-php/database v5.0.0 (released 2026-01-30) — what’s known + migration pointers
Release notes / changelog
- I couldn’t find GitHub “Release notes” published for v5.0.0 (the GitHub Releases/Tags pages currently show 4.6.x as the latest visible entries). (github.com)
- Packagist does list utopia-php/database 5.0.0 with a new dependency set (see below). (packagist.org)
Breaking changes (confirmed from 5.0.0 requirements)
From the Packagist metadata for 5.0.0: (packagist.org)
- PHP minimum is now
>= 8.4(was lower in 4.x). - Major dependency jumps that are very likely to cause BC breaks in your app:
utopia-php/cache: 1.0.*utopia-php/pools: 1.0.*
- Other listed requirements remain (extensions +
utopia-php/framework: 0.33.*,utopia-php/mongo: 0.11.*). (packagist.org)
Migration checklist (practical)
- Upgrade runtime to PHP 8.4+ (CI + production first). (packagist.org)
- In
composer.json, bump:utopia-php/databaseto^5.0- ensure compatible constraints for
utopia-php/cache1.0 andutopia-php/pools1.0 (or let Composer resolve them via the database package). (packagist.org)
- Run:
composer update utopia-php/database --with-all-dependencies
- Fix compilation/runtime issues coming from cache/pools 1.0 changes (since those are major-version upgrades). (packagist.org)
If you paste your current composer.json (or composer.lock) and what you’re upgrading from (e.g., 4.6.2 → 5.0.0), I can give a concrete, step-by-step diff-focused migration plan.
Citations:
- 1: https://github.com/utopia-php/database/releases
- 2: https://packagist.org/packages/utopia-php/database
- 3: https://packagist.org/packages/utopia-php/database
- 4: https://packagist.org/packages/utopia-php/database
- 5: https://packagist.org/packages/utopia-php/database
- 6: https://packagist.org/packages/utopia-php/database
- 7: https://packagist.org/packages/utopia-php/database
🏁 Script executed:
cat composer.jsonRepository: utopia-php/audit
Length of output: 1156
Update PHP version requirement to 8.4+ and verify cache/pools compatibility.
The upgrade to utopia-php/database 5.* introduces breaking changes that must be addressed:
-
PHP version requirement must be updated: utopia-php/database 5.0.0 requires PHP >= 8.4, but
composer.jsonstill specifies"php": ">=8.0". Update this to">=8.4"before releasing. -
Major dependency upgrades: utopia-php/database 5.0.0 now requires cache 1.0.* and pools 1.0.* (both major version bumps). Verify that the existing code works with these new versions, particularly the database adapter initialization and any cache operations.
-
Database API compatibility: The specific API changes in database 5.0.0 are not yet publicly documented. Confirm that the Document, Query, and Database client usage throughout the codebase remains compatible.
🤖 Prompt for AI Agents
In `@composer.json` at line 31, Update composer.json PHP platform requirement from
">=8.0" to ">=8.4" and ensure the dependency "utopia-php/database": "5.*" is
intended; then audit and update any code that initializes database adapters and
cache/pool usage to be compatible with the new cache 1.0.* and pools 1.0.* major
bumps—focus on constructors/factory calls used in your database adapter
initialization code (search for Database client, Query, Document instantiations
and adapter initialization functions) and review all cache operations
(get/set/pool creation) for API changes; run composer update and
unit/integration tests to catch breakages and adjust call signatures where
Document, Query, or Database client usage no longer match the new 5.x API.
Summary
utopia-php/databasefrom4.*to5.*Test plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.