I am trying to essentially recreate the Supabase "Get Schema" functionality in my own app.
I want to get outputs so I can build the functionality below.
I am getting the JSON back via an API call and a JSON Path and it is accurate! Hurray! I just dont know how to parse it...
Here's the raw for easy copy past:
[{second_table: {required: [id, created_at], properties: {id: {description: Note:This is a Primary Key.<pk/>, format: bigint, type: integer}, created_at: {default: now(), format: timestamp with time zone, type: string}, just_a_column: {format: text, type: string}}, type: object}, subabase_info: {required: [created_at, uuid], properties: {created_at: {default: now(), format: timestamp with time zone, type: string}, owner: {format: uuid, type: string}, supa_url: {format: text, type: string}, supa_anon_key: {format: text, type: string}, uuid: {default: gen_random_uuid(), description: Note:This is a Primary Key.<pk/>, format: uuid, type: string}, project_name: {format: text, type: string}, schema: {format: text, type: string}}, type: object}}]
So the above is a list of 2 tables, supabase_info, and second_table.
The column names are the "properties" of the table, with the format and types just like the first image.
The problem I seem to be having is that the object KEYS are the name of the tables and the columns.
When I try to parse into a data type it wants to create "supabase_info", and "second_table" as data types as opposed to making those the "name" of the table...
...and I suspect the same problem will arise (with the same solution) with the columns.