-
Notifications
You must be signed in to change notification settings - Fork 370
Description
Feature request
After having to manually change the JSON values of my types file every time I generate a new ones, it gets repetitive. It seems like it should possible to have those types replace automatically when the supabase gen types typescript is run.
Describe the solution you'd like
I'm not exactly sure how this would be approached, but it seems one possible solution would be to pass in a file path to a json file that mimics the organization of the generated types file, such as
{
[schemaName]: {
.. "Tables": {
.... [tableName]: {
....... [rowname]: string | number | boolean | null | {
............. ...typeJsonStructure
.......... } | {
............. ...typeJsonStructure
.......... }[]
...... }
.. },
.. "Views": {},
.. "Functions": {},
}
An example file would be like
{ public: { Tables: { user: { myJsonColumn: { customParamOne: string customParamTwo: number } } }, Views: { userView: { viewJsonColumn: { viewColOne: string: viewColTwo: { nestedOne: boolean; nestedTwo: number | string' } } } } }
Describe alternatives you've considered
I have not seen anything related to JSON specifically, but @magick93 suggested support for Custom PostgreSQL types in this issue supabase/postgres-meta#840