-- | a named (with a selector) field
instance
(KnownSymbol sel, DbaStorable' f, f ~ K1 R c, DbaField c ft, Typeable c) =>
DbaStorable' (M1 S ('MetaSel ('Just sel) su ss ds) f)
where
--
_loadDbaField store bsp fno cno vin =
M1 <$> _loadDbaField store fsp fno cno vin
where
fieldName = symbolVal (Proxy @sel)
fieldPath = fieldName ++ "::" ++ dbaBasePath @c
fsp = case bsp of
"" -> fieldPath -- a field of a top level record
_ -> bsp ++ "/" ++ fieldPath -- a field of a nested record
_storeDbaField store bsp fno cno m@(M1 xr) =
_storeDbaField store fsp fno cno xr
where
fieldName = selName m
fieldPath = fieldName ++ "::" ++ dbaBasePath @c
fsp = case bsp of
"" -> fieldPath -- a field of a top level record
_ -> bsp ++ "/" ++ fieldPath -- a field of a nested record