-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
template.handlebars
42 lines (40 loc) · 948 Bytes
/
template.handlebars
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
42
{{#*inline "schemaPartial"}}
{{#each tables as |table|}}
{{#if comment}}
/* {{comment}} */
{{/if}}
export interface {{interfaceName}} {{#if extends}}extends {{extends}} {{/if}}{
{{#each additionalProperties as |prop|}}
{{prop}}
{{/each}}
{{#each columns}}
{{#if comment}}
/* {{comment}} */
{{/if}}
'{{propertyName}}'{{#if optional}}?{{/if}}: {{propertyType}}{{#if nullable}} | null{{/if}};
{{/each}}
}
{{/each}}
{{#each enums as |enum|}}
export enum {{convertedName}} {
{{#each values as |value|}}
'{{value.convertedKey}}' = {{handleNumeric value.value}},
{{/each}}
}
{{/each}}
{{/inline}}
/*
* This file was generated by a tool.
* Rerun sql-ts to regenerate this file.
*/
{{#if config.schemaAsNamespace}}
{{#each database.schemas as |schema|}}
export namespace {{schema.namespaceName}} {
{{> schemaPartial schema}}
}
{{/each}}
{{else}}
{{#each database.schemas as |schema|}}
{{> schemaPartial schema }}
{{/each}}
{{/if}}