summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/model_table_struct.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/model_table_struct.go')
-rw-r--r--vendor/github.com/uptrace/bun/model_table_struct.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/vendor/github.com/uptrace/bun/model_table_struct.go b/vendor/github.com/uptrace/bun/model_table_struct.go
index 65e076d23..a5c9a7bc3 100644
--- a/vendor/github.com/uptrace/bun/model_table_struct.go
+++ b/vendor/github.com/uptrace/bun/model_table_struct.go
@@ -116,9 +116,6 @@ func (m *structTableModel) BeforeScanRow(ctx context.Context) error {
if m.table.HasBeforeScanRowHook() {
return m.strct.Addr().Interface().(schema.BeforeScanRowHook).BeforeScanRow(ctx)
}
- if m.table.HasBeforeScanHook() {
- return m.strct.Addr().Interface().(schema.BeforeScanHook).BeforeScan(ctx)
- }
return nil
}
@@ -144,21 +141,6 @@ func (m *structTableModel) AfterScanRow(ctx context.Context) error {
return firstErr
}
- if m.table.HasAfterScanHook() {
- firstErr := m.strct.Addr().Interface().(schema.AfterScanHook).AfterScan(ctx)
-
- for _, j := range m.joins {
- switch j.Relation.Type {
- case schema.HasOneRelation, schema.BelongsToRelation:
- if err := j.JoinModel.AfterScanRow(ctx); err != nil && firstErr == nil {
- firstErr = err
- }
- }
- }
-
- return firstErr
- }
-
return nil
}
@@ -325,7 +307,7 @@ func (m *structTableModel) scanColumn(column string, src interface{}) (bool, err
}
}
- if field, ok := m.table.FieldMap[column]; ok {
+ if field := m.table.LookupField(column); field != nil {
if src == nil && m.isNil() {
return true, nil
}