Skip to content

feat: add BigInt column type support and update related classes#167

Open
ArnabChatterjee20k wants to merge 3 commits intomainfrom
big-int
Open

feat: add BigInt column type support and update related classes#167
ArnabChatterjee20k wants to merge 3 commits intomainfrom
big-int

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR adds BigInt column type support across the migration library — introducing a new BigInt column class, a TYPE_BIG_INT constant, and wiring the type through the Appwrite source/destination and the NHost and CSV sources. The logic of the changes is sound and the NHost fix (mapping bigint/int8/numeric to BigInt instead of a 32-bit-bounded Integer) is a meaningful correctness improvement.

However, the PR has one blocking concern:

  • Unreleased dev-branch dependency: composer.json pins utopia-php/database to dev-big-init as 5.4 — a development branch that has not been tagged or released. This makes the package unstable for downstream consumers and bypasses the declared minimum-stability: stable. The PR should not be merged until the upstream library ships a proper tagged release (e.g. 5.4.0) containing BigInt support.

Additional non-blocking finding:

  • BigInt::fromArray() does not restore the signed field from the serialized array, meaning unsigned BigInt columns will incorrectly default to signed: true on deserialization. The same gap exists in Integer::fromArray() (pre-existing), but since BigInt is a new class this is a good opportunity to fix it.

Confidence Score: 4/5

Not safe to merge until utopia-php/database is released as a stable tagged version and the dev-branch alias is removed from composer.json.

The P1 issue in composer.json (dev-branch dependency) blocks merge because it introduces production instability for all downstream consumers of this library. All other application-level changes are correct and consistent with existing patterns.

composer.json (and correspondingly composer.lock) require attention — the dev-branch alias must be replaced with a stable release constraint once utopia-php/database is tagged.

Important Files Changed

Filename Overview
composer.json Pins utopia-php/database to the unreleased dev-big-init branch instead of a stable tag; this is a production risk and should not be merged until the upstream is released.
composer.lock Lock file updated to point utopia-php/database at commit ef5c77972a95129eb929cce6c8f7c674db930ec9 on the big-init branch, with stability flag set to dev (20); reflects the unstable dependency in composer.json.
src/Migration/Resources/Database/Columns/BigInt.php New BigInt column class modelled on Integer; correctly sets size=8 and delegates to parent, but fromArray() drops the signed field during deserialization.
src/Migration/Resources/Database/Column.php Adds TYPE_BIG_INT = 'bigint' constant; straightforward and correct.
src/Migration/Destinations/Appwrite.php Maps Column::TYPE_BIG_INT to UtopiaDatabase::VAR_BIGINT in the type switch; correct and consistent with surrounding mappings.
src/Migration/Sources/Appwrite.php Adds a TYPE_BIG_INT case that constructs a BigInt column from API response data, mirroring the existing Integer case.
src/Migration/Sources/NHost.php Correctly changes bigint, int8, and numeric PostgreSQL types to return a BigInt column instead of an Integer with 32-bit bounds.
src/Migration/Sources/CSV.php Adds Column::TYPE_BIG_INT alongside TYPE_INTEGER in three parsing branches; cast logic is identical and correct for 64-bit PHP environments.

Reviews (1): Last reviewed commit: "feat: add BigInt column type support and..." | Re-trigger Greptile

"ext-openssl": "*",
"appwrite/appwrite": "19.*",
"utopia-php/database": "5.*",
"utopia-php/database": "dev-big-init as 5.4",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Dev branch dependency should not be merged to main

The dependency is pinned to dev-big-init as 5.4, a development branch of utopia-php/database that has not been released as a stable version. This creates several production risks:

  • The big-init branch can be force-pushed, rebased, or deleted at any time, breaking composer install for anyone pulling this library.
  • The "minimum-stability": "stable" declared in composer.json is effectively bypassed via the stability-flags override in composer.lock (flag value 20 = dev-level stability).
  • Downstream consumers of this library will also pull the unstable dev branch.

This PR should be blocked until utopia-php/database has an official tagged release (e.g. 5.4.0) that includes BigInt support, at which point the constraint should be updated to "utopia-php/database": "5.4.*" or "5.*".

ArnabChatterjee20k and others added 2 commits March 30, 2026 15:30
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

1 participant