Skip to content

Conversation

@premtsd-code
Copy link

@premtsd-code premtsd-code commented Jan 30, 2026

Summary

  • Upgrade utopia-php/database from 4.* to 5.*
  • Required for cache 1.0.* reconnection support

Test plan

  • composer update succeeds
  • CI tests pass

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies to maintain compatibility and security standards.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Walkthrough

The pull request updates the utopia-php/database dependency version constraint in composer.json from 4.* to 5.*. This represents a major version upgrade to the database utility library. The change consists of a single line modification in the require section of the composer configuration file, with no other files or code logic affected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade database to 5.' directly and accurately summarizes the main change in the pull request, which is updating the utopia-php/database dependency from version 4. to 5.*.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-upgrade-database-5

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.*",
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
# 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 -20

Repository: 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)

  1. Upgrade runtime to PHP 8.4+ (CI + production first). (packagist.org)
  2. In composer.json, bump:
    • utopia-php/database to ^5.0
    • ensure compatible constraints for utopia-php/cache 1.0 and utopia-php/pools 1.0 (or let Composer resolve them via the database package). (packagist.org)
  3. Run:
    • composer update utopia-php/database --with-all-dependencies
  4. 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:


🏁 Script executed:

cat composer.json

Repository: 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:

  1. PHP version requirement must be updated: utopia-php/database 5.0.0 requires PHP >= 8.4, but composer.json still specifies "php": ">=8.0". Update this to ">=8.4" before releasing.

  2. 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.

  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants