@@ -38,13 +38,17 @@ mappingSpec _ =
3838 (Just baseOid, Just arrayOid) ->
3939 pure (baseOid, arrayOid)
4040 _ -> do
41- result <- Procedures. run connection Procedures. GetTypeInfoByNameParams {name = typeName}
42- let baseOid = case maybeBaseOid of
43- Just oid -> oid
44- Nothing -> fromMaybe (error $ " Base OID not found for type: " <> Text. unpack typeName) result. baseOid
45- arrayOid = case maybeArrayOid of
46- Just oid -> oid
47- Nothing -> fromMaybe (error $ " Array OID not found for type: " <> Text. unpack typeName) result. arrayOid
41+ Procedures. GetTypeInfoByNameResult {.. } <- Procedures. run connection Procedures. GetTypeInfoByNameParams {name = typeName}
42+ baseOid <- case maybeBaseOid of
43+ Just oid -> pure oid
44+ Nothing -> case baseOid of
45+ Just oid -> pure oid
46+ Nothing -> fail $ " Base OID not found for type: " <> Text. unpack typeName
47+ arrayOid <- case maybeArrayOid of
48+ Just oid -> pure oid
49+ Nothing -> case arrayOid of
50+ Just oid -> pure oid
51+ Nothing -> fail $ " Array OID not found for type: " <> Text. unpack typeName
4852 pure (baseOid, arrayOid)
4953 in describe " IsScalar" do
5054 describe (Text. unpack typeName) do
@@ -206,12 +210,12 @@ mappingSpec _ =
206210
207211 describe " Metadata" do
208212 it " Should match the DB catalogue" \ (connection :: Pq. Connection ) -> do
209- result <- Procedures. run connection Procedures. GetTypeInfoByNameParams {name = typeName}
213+ Procedures. GetTypeInfoByNameResult { .. } <- Procedures. run connection Procedures. GetTypeInfoByNameParams {name = typeName}
210214 case (maybeBaseOid, maybeArrayOid) of
211215 (Just expectedBaseOid, Just expectedArrayOid) -> do
212- shouldBe (Just expectedBaseOid) result . baseOid
213- shouldBe (Just expectedArrayOid) result . arrayOid
216+ shouldBe baseOid (Just expectedBaseOid)
217+ shouldBe arrayOid (Just expectedArrayOid)
214218 _ -> do
215219 -- For types without stable OIDs, just verify the OIDs exist
216- shouldSatisfy result . baseOid isJust
217- shouldSatisfy result . arrayOid isJust
220+ shouldSatisfy baseOid isJust
221+ shouldSatisfy arrayOid isJust
0 commit comments