xpWrap )
-- Local imports.
-import Generics ( Generic(..), to_tuple )
+import Generics ( Generic(..), prepend, to_tuple )
import TSN.Codegen ( tsn_codegen_config )
import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
import TSN.Picklers ( xp_date, xp_time_stamp )
db_nationality :: Maybe String,
db_car_number :: Int,
db_car :: String }
+ deriving ( GHC.Generic )
+
+-- | For 'Generics.prepend'.
+--
+instance Generic AutoRacingDriverListListing
+
-- | XML representation of a \<Listing\> contained within a
-- \<message\>.
-- 'AutoRacingDriverListListing', we add the foreign key and copy
-- everything else verbatim.
--
- from_xml_fk fk AutoRacingDriverListListingXml{..} =
- AutoRacingDriverListListing {
- db_auto_racing_driver_lists_id = fk,
- db_driver_id = xml_driver_id,
- db_driver = xml_driver,
- db_height = xml_height,
- db_weight = xml_weight,
- db_date_of_birth = xml_date_of_birth,
- db_hometown = xml_hometown,
- db_nationality = xml_nationality,
- db_car_number = xml_car_number,
- db_car = xml_car }
+ from_xml_fk = prepend
+
-- | This allows us to insert the XML representation