Skip to content

feat(types): add bigint support for PostgreSQL int8 (64-bit integer)#1044

Open
akbarfaa wants to merge 2 commits intosupabase:masterfrom
akbarfaa:feat/int8-bigint-support
Open

feat(types): add bigint support for PostgreSQL int8 (64-bit integer)#1044
akbarfaa wants to merge 2 commits intosupabase:masterfrom
akbarfaa:feat/int8-bigint-support

Conversation

@akbarfaa
Copy link

@akbarfaa akbarfaa commented Feb 22, 2026

This PR extends the original change (bigint support in the TypeScript generator) and adds the required fixes to make the Docker test suite green and stable across environments.

What kind of change does this PR introduce?

Feature + test stability fixes:

  • Feature: add bigint support for 64‑bit integers in the TypeScript generator.
  • Stability: make Docker-based tests pass consistently (Windows/Linux) by fixing connection handling, timeouts, and platform‑specific test scripts.

What is the current behavior?

  • PostgreSQL int8 (64‑bit signed integer) is mapped to number , which can overflow JS safe integers.
  • Docker tests can fail due to:
    • connection header overwrites,
    • inconsistent DB ports,
    • timeout vs parser‑error ordering,
    • SSL expectations in non‑SSL Docker containers,
    • Windows env var handling.

What is the new behavior?

  • int8 now maps to number | bigint (additive and backward‑compatible).
  • Docker tests are stable and green:
    • respects existing pg header values,
    • uses port 5433 for the Docker test DB,
    • tolerates timeout vs parser error behavior,
    • SSL tests accept expected errors based on environment,
    • test scripts work on Windows and Linux.

Tests

  • npm test (Docker) ✅
  • npm run check ✅

Additional context

  • The bigint change is scoped to int8 only to avoid semantic shifts for int2/int4/float4/float8/numeric .
  • CI should now pass the full Docker test matrix.

@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • int8 (64-bit) DB fields now map to TypeScript number | bigint; upstream header parsing for DB connection strings is more robust.
  • Tests

    • Added/updated tests for numeric type mappings and made tests more tolerant of environment-driven DB responses and SSL/auth variations.
  • Chores

    • Test runner and local test DB configuration updated (port/connection handling) and trigger-related test fixtures refined.

Walkthrough

Adds special handling for PostgreSQL int8 in the TypeScript generator so int8 maps to number | bigint, updates unit tests to verify this and other numeric mappings, and regenerates many typegen outputs so ID-like fields use number | bigint. Adjusts test infrastructure: docker-compose DB port to 5433 and TEST_CONNECTION_STRING to localhost:5433, replaces npm test scripts to set PG_META env via a Node inline script, relaxes several test assertions, updates trigger function definitions, and improves upstream pg header type handling in the server route.


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

@akbarfaa
Copy link
Author

This PR has been updated and all Docker tests are now green.

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