zernonia / supabase-schema

Secured & Simple Supabase Schema Visualizer
https://supabase-schema.vercel.app/
MIT License
792 stars 46 forks source link

"Export Types" fails for self-referencing foreign key #8

Closed kbsali closed 2 years ago

kbsali commented 2 years ago

I have a self-referencing foreign key on one of my tables (concretely category.parent_id), the diagram shows it perfectly, but exporting to types fails (memory leak?).

zernonia commented 2 years ago

Hi again @kbsali ! 😂
Thank you so much for reporting this issue.

Could you perhaps share a screenshot of the diagram, and a snapshot after you click export types? Appreciate it!

kbsali commented 2 years ago

Here is before adding the self ref foreign key : image

And after : image

Not sure about the "snapshot after you click export", it just won't work! :grimacing:

zernonia commented 2 years ago

Thank you so much for the input! Yeah this could be memory leak due to self referencing infinitely.

zernonia commented 2 years ago

Bugged fix on https://github.com/zernonia/supabase-schema/commit/7fb36c422a2b9dad35d0279a985bd20214f3f21b . This is indeed causes by self-referencing infinite loop.

Thank you for reporting this, and the patience! 😄

kbsali commented 2 years ago

awesome, thank YOU for being so reactive on that one! :)

lh15 commented 2 years ago

The export buttons are failing for me without a self referencing foreign key. The page crashes.

I haven't been able to debug the issue.

Screen Shot 2022-05-26 at 11 13 47 PM