zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

[Feature Request] Caching Mechanism for `zenstack generate` Command

Open tmax22 opened this issue 8 months ago • 2 comments

Hello Zenstack Team,

I'm writing to request a caching mechanism for the zenstack generate command. Currently, when dealing with large schemas containing many tables, the generation process becomes time-consuming.

  1. Caching: Implement a caching system that stores results from previous runs and reuses them if the schema hasn’t changed.
    • each plugin should decide for himself if it is safe to skip.
    • if plugin has not skipped, internal skips within each plugin can take place. for example, save cache for generated hooks/zod schemas per each table. if table wasn't change can take values from cache.
  2. Cache Invalidation: Provide a --no-cache or --force flag to manually invalidate the cache and regenerate everything from scratch.

currently generation for us takes few minutes and keeps going up. implementing such caching mechanism can easily speed up generation process from 10 minutes to few seconds.

and once again, thank for the amazing zenstack framework.

tmax22 avatar Jul 02 '24 13:07 tmax22