Allow store functions to define codegen imports
This commit is contained in:
@@ -13,6 +13,16 @@ import (
|
||||
{{- range .Import }}
|
||||
{{ normalizeImport . }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Functions}}
|
||||
{{- range .Functions }}
|
||||
{{- if .Import }}
|
||||
{{- range .Import }}
|
||||
{{ normalizeImport . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@@ -99,6 +99,7 @@ type (
|
||||
Name string `yaml:"name"`
|
||||
Arguments []storeTypeExtraArgumentDef `yaml:"arguments"`
|
||||
Return []string `yaml:"return"`
|
||||
Import []string `yaml:"import"`
|
||||
}
|
||||
|
||||
storeTypeExtraArgumentDef struct {
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Generated
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user