Skip to content

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

Merged
abnegate merged 5 commits intomainfrom
big-int
May 5, 2026
Merged

feat: add BigInt column type support and update related classes#167
abnegate merged 5 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

  • Introduces BigInt column type with supporting changes across Appwrite source/destination, CSV source, and NHost source; the core mapping and serialization logic is structurally sound.
  • BigInt constructor sets $min ??= PHP_INT_MIN unconditionally, so an unsigned BigInt (signed = false) created without an explicit min will record a large negative minimum in its schema metadata, contradicting the signed flag.
  • Carries forward the pre-existing pattern in NHost.php of mapping PostgreSQL numeric (arbitrary-precision decimal) to an integer type, which silently loses fractional values; the PR moves this mapping from Integer to BigInt without correcting it.

Confidence Score: 4/5

Mostly safe to merge, but the unsigned min-default bug in BigInt will silently corrupt schema metadata for any unsigned BigInt column migrated without an explicit min value.

One P1 finding (incorrect default min for unsigned BigInt) sets the ceiling at 4/5. All other issues are pre-existing or minor docblock gaps.

src/Migration/Resources/Database/Columns/BigInt.php — unsigned min default logic; src/Migration/Sources/NHost.php — numeric/decimal type mapping.

Important Files Changed

Filename Overview
src/Migration/Resources/Database/Columns/BigInt.php New BigInt column class; signed is correctly read in fromArray(), but the default min logic ignores signedness and the signed field is missing from the @param docblock type declaration.
src/Migration/Resources/Database/Column.php Adds TYPE_BIG_INT = 'bigint' constant; straightforward and correct.
src/Migration/Destinations/Appwrite.php Adds TYPE_BIG_INT => VAR_BIGINT to the type-mapping match; correctly placed and complete.
src/Migration/Sources/Appwrite.php Adds BigInt case in column-parsing switch; signed defaults to true when absent (already flagged in previous review round).
src/Migration/Sources/CSV.php BigInt values are correctly matched alongside INTEGER in all three relevant match arms; no new issues.
src/Migration/Sources/NHost.php numeric/decimal (arbitrary-precision) still grouped with bigint/int8 and mapped to BigInt, silently truncating fractional values (pre-existing pattern carried into new code).
composer.json Depends on dev-big-init as 5.77, an unreleased development branch of utopia-php/database; already flagged in a previous review round.

Reviews (3): Last reviewed commit: "updated" | Re-trigger Greptile

Comment thread composer.json Outdated
Comment thread src/Migration/Resources/Database/Columns/BigInt.php
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>
Comment thread src/Migration/Sources/Appwrite.php
Comment thread src/Migration/Resources/Database/Columns/BigInt.php
@abnegate abnegate merged commit e8bee97 into main May 5, 2026
4 checks passed
@abnegate abnegate deleted the big-int branch May 5, 2026 23:31
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