generic-persistence-0.2.0.0: Database persistence using generics
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.GP.RecordtypeReflection

Synopsis

Documentation

fieldValue :: Data a => a -> String -> SqlValue Source #

A function that takes an entity and a field name as input parameters and returns the value of the field as a String. Example: fieldValue (Person John 42) "name" = SqlString John Example: fieldValue (Person John 42) "age" = SqlInt64 42 if the field is not present in the entity, an error is thrown.

gFromRow :: forall a. Data a => [SqlValue] -> a Source #

gToRow :: Data a => a -> [SqlValue] Source #