Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: drizzle-zod output to static files #2494

Open
carafelix opened this issue Jun 12, 2024 · 2 comments
Open

[Feature Request]: drizzle-zod output to static files #2494

carafelix opened this issue Jun 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@carafelix
Copy link

carafelix commented Jun 12, 2024

Describe what you want

Instead of generating the zod representation at runtime, I would like to be able to codegen it into a static file.
Like:

export const insertPoemSchema = createInsertSchema(PoemTable, {output: './poemSchema.ts'});

or a CLI equivalent

// generated poemSchema.ts
export const insertPoemSchema = z.object({
  title: z.string(),
  text: z.string()
  // etc etc
})
@carafelix carafelix added the enhancement New feature or request label Jun 12, 2024
@carafelix carafelix changed the title [FEATURE]: Introspection to static files [FEATURE]: Introspection output to static files Jun 12, 2024
@carafelix carafelix changed the title [FEATURE]: Introspection output to static files [FEATURE]: drizzle-zod output to static files Jun 12, 2024
@MiraiSubject
Copy link

Why is this issue closed? Does this feature exist already? If so where is it documented?

@carafelix carafelix changed the title [FEATURE]: drizzle-zod output to static files [Feature Request]: drizzle-zod output to static files Jun 18, 2024
@carafelix
Copy link
Author

carafelix commented Jun 18, 2024

Does this feature exist already? If so where is it documented?

As far as I'm aware, it does not exist.

Why is this issue closed?

After finding out that drizzle-zod was runtime agnostic, I didn't see much use case for it.
I'll re-open it since it looks it might be useful for someone else.

@carafelix carafelix reopened this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants