Skip to content

Conversation

tylermmorton
Copy link

I've run into a snag recently while using Jet's postgres generator. It completely cleans the output directory when it goes to process code generation on a database schema.

The way that my project is set up, I want to generate multiple schemas into the same directory while also having each schema be in its own subpackage:

   /storage
     /schema
       /public
       /computed
       /telemetry

Unfortunately I can't do this when I call ProcessDB multiple times, because it ends up clearing the /schema folder of the files it just generated.

I tried my best to make the proposed changes backwards compatible but I'm open to feedback. I'll maintain a fork of jet for now but I'd love to see this feature merged.

Thanks

Copy link

codecov bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 11.11111% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.95%. Comparing base (afc4cee) to head (fc748e9).

Files with missing lines Patch % Lines
generator/postgres/postgres_generator.go 0.00% 30 Missing ⚠️
generator/template/process.go 33.33% 8 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (11.11%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #520      +/-   ##
==========================================
- Coverage   91.35%   90.95%   -0.41%     
==========================================
  Files         136      136              
  Lines        8340     8380      +40     
==========================================
+ Hits         7619     7622       +3     
- Misses        545      581      +36     
- Partials      176      177       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@go-jet
Copy link
Owner

go-jet commented Aug 26, 2025

because it ends up clearing the /schema folder of the files it just generated.

This shouldn't be the case. If you regenerate public schema computed and telemetry should remain intact.

How are you invoking the generator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants