Remove unused CustomRowScanner & RowScanners features from store

This commit is contained in:
Denis Arh
2022-02-12 09:00:13 +01:00
parent 2d90fe4e9e
commit 1949782ccd
43 changed files with 476 additions and 672 deletions
+4 -13
View File
@@ -556,20 +556,11 @@ func (s Store) execDelete{{ export $.Types.Plural }}(ctx context.Context, cnd sq
func (s Store) internal{{ export $.Types.Singular }}RowScanner({{ template "extraArgsDefFirst" . }}row rowScanner) (res *{{ $.Types.GoType }}, err error) {
res = &{{ $.Types.GoType }}{}
if _, has := s.config.RowScanners[{{ printf "%q" (unexport $.Types.Singular) }}]; has {
scanner := s.config.RowScanners[{{ printf "%q" (unexport $.Types.Singular) }}].(func({{ template "extraArgsDefFirst" . }}_ rowScanner, _ *{{ $.Types.GoType }}) error)
err = scanner({{ template "extraArgsCallFirst" . }}row, res)
} else {
{{- if .RDBMS.CustomRowScanner }}
err = s.scan{{ $.Types.Singular }}Row({{ template "extraArgsCallFirst" . }}row, res)
{{- else }}
err = row.Scan(
{{- range $.RDBMS.Columns }}
&res.{{ .Field }},
{{- end }}
)
err = row.Scan(
{{- range $.RDBMS.Columns }}
&res.{{ .Field }},
{{- end }}
}
)
if err == sql.ErrNoRows {
return nil, store.ErrNotFound.Stack(1)
-2
View File
@@ -82,7 +82,6 @@ type (
Alias string `yaml:"alias,omitempty"`
Table string `yaml:"table,omitempty"`
CustomRowScanner bool `yaml:"customRowScanner"`
CustomFilterConverter bool `yaml:"customFilterConverter"`
CustomSortConverter bool `yaml:"customSortConverter"`
CustomCursorCollector bool `yaml:"customCursorCollector"`
@@ -221,7 +220,6 @@ func procStore(mm ...string) ([]*storeDef, error) {
Source: m,
RDBMS: storeTypeRdbmsDef{
CustomRowScanner: false,
CustomFilterConverter: false,
CustomEncoder: false,
},