Skip to content

Generating types for a postgresql array results in Typescript unknown property #581

Closed
@tom-at-pixel

Description

@tom-at-pixel

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Generating TypeScript types for a Supabase project is resulting in unexpected unknown properties. Specifically, any array type (e.g. text[]) generates unknown (instead of e.g. string[]).

To Reproduce

  1. Define any type with text[] in Supabase:
CREATE TYPE example_type AS (
  my_text_array text[]
);
  1. Generate types in client project:
npx supabase gen types typescript --schema public

Observe the unknown property in the generated TypeScript types:

example_type: {
  my_text_array: unknown
}

Expected behavior

I would expect a string[] property in the generated types:

example_type: {
  my_text_array: string[]
}

System information

  • OS: MAC OS
  • Version of supabase CLI: 1.60.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions