MCPcopy
hub / github.com/pocketbase/pocketbase / normalizeValue

Method normalizeValue

core/field_select.go:156–167  ·  view source on GitHub ↗
(raw any)

Source from the content-addressed store, hash-verified

154}
155
156func (f *SelectField) normalizeValue(raw any) any {
157 val := list.ToUniqueStringSlice(raw)
158
159 if !f.IsMultiple() {
160 if len(val) > 0 {
161 return val[len(val)-1] // the last selected
162 }
163 return ""
164 }
165
166 return val
167}
168
169// DriverValue implements the [DriverValuer] interface.
170func (f *SelectField) DriverValue(record *Record) (driver.Value, error) {

Callers 2

PrepareValueMethod · 0.95
setValueMethod · 0.95

Calls 2

IsMultipleMethod · 0.95
ToUniqueStringSliceFunction · 0.92

Tested by

no test coverage detected