DEV Community

Discussion on: Understanding Data Types in Supabase

Collapse
 
johnniyontwali profile image
John Niyontwali

Is there a way to define the data to go within the json. An example:

create table books (
  id serial primary key,
  name text,
  email text,
  addresses jsonb
);
Enter fullscreen mode Exit fullscreen mode

Is there a way I can define the data that should go in the address, lets say I have an interface of :

export interface Tenants {
  id: string;
  name: string;
  email: string;
  addresses: {
    street: string;
    postal: string;
    address: string;
    city: string;
    postalCode: string;
    country: string;
    website: string;
  };
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
kvetoslavnovak profile image
kvetoslavnovak

Exactly the same question I have as well.