MCPcopy
hub / github.com/pocketbase/pocketbase / PostScan

Method PostScan

core/record_model.go:583–595  ·  view source on GitHub ↗

PostScan implements the [dbx.PostScanner] interface. It essentially refreshes/updates the current Record original state as if the model was fetched from the databases for the first time. Or in other words, it means that m.Original().FieldsData() will have the same values as m.Record().FieldsData()

()

Source from the content-addressed store, hash-verified

581// Or in other words, it means that m.Original().FieldsData() will have
582// the same values as m.Record().FieldsData().
583func (m *Record) PostScan() error {
584 if m.Id == "" {
585 return errors.New("missing record primary key")
586 }
587
588 if err := m.BaseModel.PostScan(); err != nil {
589 return err
590 }
591
592 m.originalData = m.FieldsData()
593
594 return nil
595}
596
597// HookTags returns the hook tags associated with the current record.
598func (m *Record) HookTags() []string {

Callers 3

TestRecordPostScanFunction · 0.95

Calls 1

FieldsDataMethod · 0.95

Tested by 2

TestRecordPostScanFunction · 0.76