Skip to content

Commit febec9a

Browse files
committed
remove formatType
1 parent 156bdfb commit febec9a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

plugins/source/docs.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"sort"
1212
"text/template"
1313

14-
"github.com/apache/arrow/go/v13/arrow"
1514
"github.com/cloudquery/plugin-sdk/v3/caser"
1615
"github.com/cloudquery/plugin-sdk/v3/schema"
1716
)
@@ -147,7 +146,7 @@ func (p *Plugin) jsonifyTables(tables schema.Tables) []jsonTable {
147146
for c, col := range table.Columns {
148147
jsonColumns[c] = jsonColumn{
149148
Name: col.Name,
150-
Type: formatType(col.Type),
149+
Type: col.Type.String(),
151150
IsPrimaryKey: col.PrimaryKey,
152151
IsIncrementalKey: col.IncrementalKey,
153152
}
@@ -204,8 +203,7 @@ func (p *Plugin) renderAllTables(t *schema.Table, dir string) error {
204203

205204
func (p *Plugin) renderTable(table *schema.Table, dir string) error {
206205
t := template.New("").Funcs(map[string]any{
207-
"formatType": formatType,
208-
"title": p.titleTransformer,
206+
"title": p.titleTransformer,
209207
})
210208
t, err := t.New("table.md.go.tpl").ParseFS(templatesFS, "templates/table.md.go.tpl")
211209
if err != nil {
@@ -232,10 +230,6 @@ func formatMarkdown(s string) string {
232230
return reMatchHeaders.ReplaceAllString(s, `$1`+"\n\n")
233231
}
234232

235-
func formatType(v arrow.DataType) string {
236-
return v.String()
237-
}
238-
239233
func indentToDepth(table *schema.Table) string {
240234
s := ""
241235
t := table

plugins/source/templates/table.md.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ The following tables depend on {{.Name}}:
4040
| Name | Type |
4141
| ------------- | ------------- |
4242
{{- range $column := $.Columns }}
43-
|{{$column.Name}}{{if $column.PrimaryKey}} (PK){{end}}{{if $column.IncrementalKey}} (Incremental Key){{end}}|{{$column.Type | formatType}}|
43+
|{{$column.Name}}{{if $column.PrimaryKey}} (PK){{end}}{{if $column.IncrementalKey}} (Incremental Key){{end}}|{{$column.Type}}|
4444
{{- end }}

0 commit comments

Comments
 (0)