@@ -13,6 +13,7 @@ Instances are governed by the `Generic` and `HasDatatype` typeclasses.
1313>>> import Control.Monad.Base
1414
1515>>> import Squeal.PostgreSQL
16+>>> import qualified Squeal.PostgreSQL as SQL
1617
1718>>> data Schwarma = Beef | Lamb | Chicken deriving (Show, GHC.Generic)
1819>>> instance Generic Schwarma
@@ -28,6 +29,7 @@ void . withConnection "host=localhost port=5432 dbname=exampledb" $ do
2829:}
2930Beef
3031
32+>>> :set -XTypeFamilies -XTypeInType -XUndecidableInstances
3133>>> :{
3234type family Schema :: SchemaType where
3335 Schema =
@@ -50,7 +52,7 @@ let
5052 insertRow_ #tab (Set (param @1) `As` #col :* Nil)
5153 :: Manipulation Schema '[ 'NotNull (EnumWith Schwarma)] '[]
5254 qry =
53− select (#col `As` #fromOnly :* Nil) (from (table #tab))
55+ select (#col `As` #fromOnly :* Nil) (SQL.from (table #tab))
5456 :: Query Schema '[] '["fromOnly" ::: 'NotNull (EnumWith Schwarma)]
5557 session = do
5658 manipulateParams manip (Only Chicken)