@@ -21,11 +21,10 @@ main = do
2121 Left err -> putStrLn (show err)
2222 Right sessionId -> do
2323 --4. define a new relation variable with a DatabaseContext expression
24− let attrExprs = [AttributeAndTypeNameExpr "name" (PrimitiveTypeConstructor "Text" textAtomType),
25− AttributeAndTypeNameExpr "age" (PrimitiveTypeConstructor "Int" intAtomType)]
26− attrs = attributesFromList [Attribute "name" textAtomType,
27− Attribute "age" intAtomType]
28− mErr1 <- executeDatabaseContextExpr sessionId conn (Define "person" attrExprs)
24+ let attrList = [Attribute "name" textAtomType,
25+ Attribute "age" intAtomType]
26+ attrs = attributesFromList attrList
27+ mErr1 <- executeDatabaseContextExpr sessionId conn (Define "person" (map NakedAttributeExpr attrList))
2928 putStrLn (show mErr1)
3029 --5. add a tuple to the relation referenced by the relation variable
3130 let (Right tupSet) = mkTupleSetFromList attrs [[textAtom "Bob", intAtom 45]]