You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be nice if there was a way to achieve this without needing to execute a binary. Failing that, a sanctioned way to run the binary would be an improvement.
This requires having the file written out to the file-system. Ideally I'd like to be able to do all this in memory before having to write to disk. In my use case I'm generating a collection of schemas and want to be able to take a hash of the (formatted) schema and look it up and only write to disk if it's a new schema. Writing to disk just to format the file so that I can check whether I need to write to disk is a bit of overkill. (I also realise that what I'm doing is perhaps outside of what could be considered regular usage of the library :-) )
janpio
changed the title
Formatting Prisma 2 schema programmatically in JavaScript
Formatting Prisma 2 schema programmatically in JavaScript (file and string)
Aug 21, 2020
Problem
I am programmatically generating a prisma schema. Before I write it to a file I would like to ensure it is correctly formatted.
I currently achieve this with the following code:
it would be nice if there was a way to achieve this without needing to execute a binary. Failing that, a sanctioned way to run the binary would be an improvement.
Suggested solution
I imagine a solution that looked something like:
Additional context
See discussion here
The text was updated successfully, but these errors were encountered: