gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
487 stars 40 forks source link

Add `preview --types` flag #27

Closed gernest closed 6 years ago

gernest commented 6 years ago

This shows the actual database types and converted types.

It helps templates developers to know which types have already assigned conversion.

We list types across all schemas. Avoids listing duplicate types.

Closes #11

natefinch commented 6 years ago

This is great, but I think we need to rethink how to do yaml vs types... because you shouldn't ever set both of those.

I think we should change the flag to be --format that can have the values tabular, yaml, or types (or json, but that can be a separate feature). With tabular as the default

gernest commented 6 years ago

I agree! something like like gnorm preview --format yaml

natefinch commented 6 years ago

Yep.

And then we should probably change the interface of Preview in the run package to be PreviewYaml, PreviewTypes, PreviewTabular ... that way we're not passing around a bunch of booleans.

gernest commented 6 years ago

Great, I didn't want to make drastic changes to the project, but that would have been the way I would have handled this!

I will submit a separate PR with the new changes.

BTW: I think we should have a default value incase the user never specified any!

gernest commented 6 years ago

@natefinch At the top level I believe we should keep Preview and not have PreviewYaml etc. When I submit the changes we will see what you think.

gernest commented 6 years ago

Closing this in favor or #31