outerbase / sdk

Typescript ORM and automated model generation direct from your database schema. Supports Outerbase features for saved queries & AI.
https://outerbase.com
MIT License
12 stars 5 forks source link

Delete paths when generating models #35

Closed Brayden closed 5 months ago

Brayden commented 5 months ago

Purpose

Currently when you run the generate-models script if you had tables that had previously existed and no longer do, those models would not be deleted on the next run. This approach makes certain that each path we write a model to is at first removed before the path is re-created making is no previous models remain and only current ones are created.

This pull request does NOT resolve if an entire schema was deleted as a sibling to public that it will be removed in the folder structure. The current execution of this code would not know that path exists.

Resolves #34

Tasks

Verify

Before

After