FeatureFuel
43

Better Typescript Types

Source: supabase/supabase#13364 · opened by @FroggyPanda
The current way to extract row types from supabases typescript types is like so:

which, in my opinion, is not the best way to do it. Whenever I want to make sure my function return type is the same type as my database, I need to make a new type in that file or have another file that holds all of my table types. I am thinking of on top of generating the Database type, supabase also generates the row types, so there is no need to do that long type abstraction when, in my opinion, it should be as easy as:


Edit 1: Edited title from 'Better Typesciprt Row Types' to 'Better Typescript Types' as I feel [Barry's reply]( and others can help improve the types generated

Edit 2: Going to do a shameless plug for [better-supabase-type]( and [Barry's supabase-react-query-codegen]( Hope people who would like to see supabase have better first-party types find these packages useful, and the supabase team gets inspiration from these projects.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests