Skip to content

Conversation

@MuzzaiyyanHussain
Copy link
Contributor

Fixes #1030

Problem

When generating TypeScript types, nullable INTERVAL columns are currently inferred as string
instead of string | null. This breaks type safety because the database allows NULL values
but the generated types do not reflect that.

Changes

  • Updated TypeScript type generation to correctly respect is_nullable for INTERVAL columns
  • Added tests to ensure nullable INTERVAL fields are typed as string | null

Result

Developers now get accurate TypeScript types that match the database schema,
preventing runtime null issues and improving overall type safety.

@MuzzaiyyanHussain
Copy link
Contributor Author

@avallete

Copy link
Member

@avallete avallete left a comment

Choose a reason for hiding this comment

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

Thank's for your contribution !

Added an e2e test to ensure it works for both nullable and not nullable fields, and check the final type generated result.

@coveralls
Copy link

coveralls commented Jan 7, 2026

Pull Request Test Coverage Report for Build 20807237661

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 83.907%

Totals Coverage Status
Change from base Build 20160694137: 0.002%
Covered Lines: 6258
Relevant Lines: 7343

💛 - Coveralls

timestamptz: 'datetime.datetime',
uuid: 'uuid.UUID',
vector: 'list[Any]',
interval: 'str',
Copy link
Member

Choose a reason for hiding this comment

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

cc @o-santi @silentworks might be a better type for this in Python, mapping to str as it's the format for Typescript. WDYT ?

@MuzzaiyyanHussain
Copy link
Contributor Author

@soedirgo ?

@avallete avallete merged commit a56f296 into supabase:master Jan 9, 2026
7 checks passed
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.

Nullable INTERVAL columns are inferred as string instead of string | null in generated TypeScript types

3 participants