diff --git a/src/Database/Persist/Sql/Graph/Cyclic.hs b/src/Database/Persist/Sql/Graph/Cyclic.hs index 207dcbc..e8ae3ff 100644 --- a/src/Database/Persist/Sql/Graph/Cyclic.hs +++ b/src/Database/Persist/Sql/Graph/Cyclic.hs @@ -132,7 +132,7 @@ xcyclicn' follow filter minitials proxy = do Just initials -> mconcat [ " FROM ", dbname $ entityDB tNode , " WHERE ", entityDB tNode ^* fieldDB (entityId tNode) - , " IN ?" + , " = ANY(?)" ] ] diff --git a/src/Database/Persist/Sql/Graph/Path.hs b/src/Database/Persist/Sql/Graph/Path.hs index 261d6f3..4d8e8d6 100644 --- a/src/Database/Persist/Sql/Graph/Path.hs +++ b/src/Database/Persist/Sql/Graph/Path.hs @@ -157,7 +157,7 @@ xmpathm' follow filter msource mdest mlen mlim proxy = do Just _ -> mconcat [ " FROM ", dbname $ entityDB tNode , " WHERE ", entityDB tNode ^* fieldDB (entityId tNode) - , " IN ?" + , " = ANY(?)" ] , " UNION ALL " , case follow of @@ -174,10 +174,10 @@ xmpathm' follow filter msource mdest mlen mlim proxy = do , " FROM ", dbname temp , case mdest of Nothing -> "" - Just _ -> " WHERE ", temp ^* tid, " IN ?" + Just _ -> " WHERE " <> temp ^* tid <> " = ANY(?)" , case mlen of Nothing -> "" - Just _ -> " AND array_length(", temp ^* tpath, ", 1) <= ?" + Just _ -> " AND array_length(" <> temp ^* tpath <> ", 1) <= ?" , " ORDER BY array_length(", temp ^* tpath, ", 1)" , case mlim of Nothing -> "" diff --git a/src/Database/Persist/Sql/Graph/Reachable.hs b/src/Database/Persist/Sql/Graph/Reachable.hs index 2572a58..ffefb12 100644 --- a/src/Database/Persist/Sql/Graph/Reachable.hs +++ b/src/Database/Persist/Sql/Graph/Reachable.hs @@ -127,7 +127,7 @@ xreachable' follow filter initials mlen proxy = do , "FALSE" , " FROM ", dbname $ entityDB tNode , " WHERE ", entityDB tNode ^* fieldDB (entityId tNode) - , " IN ?" + , " = ANY(?)" , " UNION ALL " , case follow of FollowForward -> sqlStep fwd bwd @@ -144,7 +144,7 @@ xreachable' follow filter initials mlen proxy = do , " WHERE NOT ", temp ^* tcycle , case mlen of Nothing -> "" - Just _ -> " AND array_length(", temp ^* tpath, ", 1) <= ?" + Just _ -> " AND array_length(" <> temp ^* tpath <> ", 1) <= ?" ] toP = fmap toPersistValue toPL = PersistList . map toPersistValue diff --git a/src/Database/Persist/Sql/Graph/TransitiveReduction.hs b/src/Database/Persist/Sql/Graph/TransitiveReduction.hs index c361f94..240c5c2 100644 --- a/src/Database/Persist/Sql/Graph/TransitiveReduction.hs +++ b/src/Database/Persist/Sql/Graph/TransitiveReduction.hs @@ -114,7 +114,7 @@ trrSelect proxy = do , "FALSE" , " FROM ", dbname $ entityDB tNode , " WHERE ", entityDB tNode ^* fieldDB (entityId tNode) - , " IN ?" + , " = ANY(?)" , " UNION ALL " , sqlStep fwd bwd , " )" @@ -198,7 +198,7 @@ trrApply proxy = do , "FALSE" , " FROM ", dbname $ entityDB tNode , " WHERE ", entityDB tNode ^* fieldDB (entityId tNode) - , " IN ?" + , " = ANY(?)" , " UNION ALL " , sqlStep fwd bwd , " ) DELETE FROM ", dbname $ entityDB tEdge