Support for range types

Open
#840 5 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, typescript
Domain
databases

Research direction

Start by locating the TypeScript type-generation logic that maps PostgreSQL column types, then inspect how existing PostgreSQL types are handled. Verify the generated types for tstzrange and the other PostgreSQL range types described in the issue, including nullable columns.

Written by the indexing model from the issue text.

Description

enhancement

Feature request

Is your feature request related to a problem? Please describe.

When generating types columns that use a range are being generated with unknown.

For example:

CREATE TABLE public.sample_table (
	duration tstzrange NULL
);

Will generate:

sample_table: {
        Row: {
          duration: unknown | null
        }
        Insert: {
          duration?: unknown | null
        }
        Update: {
          duration?: unknown | null
        }
      }

As there are already several range types in Postgres these should be supported.

Dominant language
TypeScript
Stars
1.2k
Forks
223
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/postgres-meta

All issues in supabase/postgres-meta

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.