MCPcopy
hub / github.com/pocketbase/pocketbase / Scan

Method Scan

core/fields_list.go:370–388  ·  view source on GitHub ↗

Scan implements [sql.Scanner] interface to scan the provided value into the current FieldsList instance.

(value any)

Source from the content-addressed store, hash-verified

368// Scan implements [sql.Scanner] interface to scan the provided value
369// into the current FieldsList instance.
370func (l *FieldsList) Scan(value any) error {
371 var data []byte
372 switch v := value.(type) {
373 case nil:
374 // no cast needed
375 case []byte:
376 data = v
377 case string:
378 data = []byte(v)
379 default:
380 return fmt.Errorf("failed to unmarshal FieldsList value %q", value)
381 }
382
383 if len(data) == 0 {
384 data = []byte("[]")
385 }
386
387 return l.UnmarshalJSON(data)
388}

Callers 4

TestFieldsListScanFunction · 0.95
parseMethod · 0.45
executeQueryFunction · 0.45
newDynamicModelFunction · 0.45

Calls 1

UnmarshalJSONMethod · 0.95

Tested by 1

TestFieldsListScanFunction · 0.76