All checks were successful
CI / Test (1.24) (push) Successful in -25m5s
CI / Test (1.25) (push) Successful in -24m57s
CI / Build (push) Successful in -26m5s
CI / Lint (push) Successful in -25m51s
Integration Tests / Integration Tests (push) Successful in -25m42s
Release / Build and Release (push) Successful in -24m39s
* Introduce `--flatten-schema` flag to convert, merge, and split commands. * Modify database writing functions to support flattened schema names. * Update template functions to handle schema.table naming convention. * Enhance PostgreSQL writer to utilize flattened schema in generated SQL. * Update tests to ensure compatibility with new flattening feature. * Dependencies updated for improved functionality.
45 lines
1.0 KiB
Cheetah
45 lines
1.0 KiB
Cheetah
{{/* Reusable template fragments */}}
|
|
|
|
{{/* Column definition fragment */}}
|
|
{{- define "column_definition" -}}
|
|
{{.Name}} {{.Type}}
|
|
{{- if .Default}} DEFAULT {{.Default}}{{end}}
|
|
{{- if .NotNull}} NOT NULL{{end}}
|
|
{{- end -}}
|
|
|
|
{{/* Comma-separated column list */}}
|
|
{{- define "column_list" -}}
|
|
{{- range $i, $col := . -}}
|
|
{{- if $i}}, {{end}}{{$col}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/* Qualified table name */}}
|
|
{{- define "qualified_table" -}}
|
|
{{qual_table_raw .SchemaName .TableName}}
|
|
{{- end -}}
|
|
|
|
{{/* Index method clause */}}
|
|
{{- define "index_method" -}}
|
|
{{- if .IndexType}}USING {{.IndexType}}{{end -}}
|
|
{{- end -}}
|
|
|
|
{{/* Uniqueness keyword */}}
|
|
{{- define "unique_keyword" -}}
|
|
{{- if .Unique}}UNIQUE {{end -}}
|
|
{{- end -}}
|
|
|
|
{{/* Referential action clauses */}}
|
|
{{- define "referential_actions" -}}
|
|
{{- if .OnDelete}}
|
|
ON DELETE {{.OnDelete}}
|
|
{{- end}}
|
|
{{- if .OnUpdate}}
|
|
ON UPDATE {{.OnUpdate}}
|
|
{{- end}}
|
|
{{- end -}}
|
|
|
|
{{/* Comment statement */}}
|
|
{{- define "comment_on" -}}
|
|
COMMENT ON {{.ObjectType}} {{.ObjectName}} IS {{quote .Comment}};
|
|
{{- end -}} |