3
0

Allow store functions to define codegen imports

This commit is contained in:
Tomaž Jerman
2021-08-17 10:26:32 +02:00
parent 244b0cf8ed
commit b95e878c92
4 changed files with 13 additions and 2 deletions
+10
View File
@@ -13,6 +13,16 @@ import (
{{- range .Import }}
{{ normalizeImport . }}
{{- end }}
{{- if .Functions}}
{{- range .Functions }}
{{- if .Import }}
{{- range .Import }}
{{ normalizeImport . }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
)
type (
+1
View File
@@ -99,6 +99,7 @@ type (
Name string `yaml:"name"`
Arguments []storeTypeExtraArgumentDef `yaml:"arguments"`
Return []string `yaml:"return"`
Import []string `yaml:"import"`
}
storeTypeExtraArgumentDef struct {
+2 -1
View File
@@ -1,6 +1,5 @@
import:
- github.com/cortezaproject/corteza-server/compose/types
- github.com/cortezaproject/corteza-server/pkg/report
types:
type: types.Record
@@ -27,6 +26,8 @@ functions:
return: [ "[]map[string]interface{}", error ]
- name: ComposeRecordDatasource
import:
- github.com/cortezaproject/corteza-server/pkg/report
arguments:
- { name: mod, type: "*types.Module" }
- { name: ld, type: "*report.LoadStepDefinition" }
-1
View File
@@ -11,7 +11,6 @@ package rdbms
import (
"context"
"database/sql"
"github.com/Masterminds/squirrel"
"github.com/cortezaproject/corteza-server/compose/types"
"github.com/cortezaproject/corteza-server/pkg/errors"