gnormal / gnorm

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

Common embedded templates #60

Open natefinch opened 6 years ago

natefinch commented 6 years ago

Give users the ability to define templates that are parsed as embedded templates in the main schema enum and table templates. This can be a great way to swap out content in templates so as to support multiple databases more easily. A good example is how postgres vs other databases specify value place holders. postgres wants $1 $2 etc and others want ? ? . if you have a "values" template that defines how to render that, then instead of copying the whole table template for each database type, you just need to swap out the values template.