-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.tpl
41 lines (32 loc) · 975 Bytes
/
example.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Example template
----------------
Table:
- name: {{ Table.Name }}
- go struct name: {{ Table.GoStructName }}
- template used: {{ Table.Template }}
{% macro dump_columns(cols) %}
{% for c in cols %}{{ dump_column(c) }}{% endfor %}
{% endmacro %}
{% macro dump_column(c) %}PGColumnName : {{ c.PGColumnName }}
PGDataType : {{ c.PGDataType }}
PGOrdinalPosition : {{ c.PGOrdinalPosition }}
IsPK : {{ c.IsPK }}
GoFieldName : {{ c.GoFieldName }}
PgxType : {{ c.PgxType }}
JSON : {{ c.JSON}}
{% endmacro %}
SELECTable columns
------------------
{{ dump_columns(Table.SelectableColumns) }}
INSERTable columns
------------------
{{ dump_columns(Table.InsertableColumns) }}
UPDATEable columns
------------------
{{ dump_columns(Table.UpdateableColumns) }}
Primary keys
------------
{% for c in Table.Pks %}{{ dump_column(c) }}{% endfor %}
all columns
-----------
{% for c in Table.Columns%}{{ dump_column(c) }}{% endfor %}