Skip to content

Code template instruction

chen edited this page Feb 18, 2023 · 4 revisions

Text Template

DbToys use scriban as text template.

Also, there's some extra customized string functions:

  • string.to_camal_case
  • string.to_pascal_case
  • string.to_snake_case
  • string.to_singular
  • string.to_plural
  • string.to_kebab_case

Global Templates

The global templates will be appended to the start of the other templates.

Define output filename

The output filename must defined in the template file.

{{~ filename = (table.clean_name | string.to_pascal_case | string.to_plural) + ".cs" ~}} 

Injected variable

Clone this wiki locally