In this recipe, we have touched upon many aspects of defining, storing, and querying the model. Let's us look at each aspect one by one.
The definition of the model starts with the following statement:
share [mkPersist sqlSettings, mkMigrate "migrateAll"]
This definition shows how we would like to persist the model. sqlSettings denotes that we would like to use a SQL backend for storing the model. mkMigrate takes a string argument. This should be name of the function (in this case, migrateAll) that represents the creation of all the schemata defined in the model.
The model itself is defined within [persistLowerCase| ...]. It persists the names of tables and fields using lowercase letters. The following definition of Stock ...