Replies: 1 comment
-
Please see my fork of the MySQL-Zod project (the "other" utility that's like MySQL-to-Zod). In the README for this branch where the JSON options are documented, I have a "datetime" node that provides many options for how this type is processed. My point is that validation may not be limited purely to "strict" or "not strict", but within each type there may be other choices. Yes, there can be a high-level default, with later options defining overrides. I've been thinking about a structure like this that can be implemented in the .js config file:
By simply copy/pasting a preference and setting typeSpecs, a developer can generate code for a different application, and just reset it again to regenerate code for any database. ( Note, please ignore the branches and their code. It requires explanation outside of context. That code has not yet been PR'd upstream and may never go production. ) |
Beta Was this translation helpful? Give feedback.
-
for example
tinyint -128to127 or 0to255 (from table definition)
smallint -32768to32767 or 0to65535
I want to create a strict mode based on the MySQL specification.
I'm thinking about how to specify options; would the format of specifying what you want to be strict be good? Or should I specify what I don't want to be strict? Do most people want to use a strict zod schema or not? Which would it be?
Beta Was this translation helpful? Give feedback.
All reactions