persistent 1.3.0.5 → 1.3.0.6
raw patch · 2 files changed
+5/−3 lines, 2 files
Files
Database/Persist/Sql/Orphan/PersistStore.hs view
@@ -90,12 +90,14 @@ let composite = isJust $ entityPrimary t let cols = T.intercalate "," $ map (connEscapeName conn . fieldDB) $ entityFields t+ noColumns :: Bool+ noColumns = null $ entityFields t let wher = case entityPrimary t of Just pdef -> T.intercalate " AND " $ map (\fld -> connEscapeName conn (snd fld) <> "=? ") $ primaryFields pdef Nothing -> connEscapeName conn (entityID t) <> "=?" let sql = T.concat [ "SELECT "- , cols+ , if noColumns then "*" else cols , " FROM " , connEscapeName conn $ entityDB t , " WHERE "@@ -106,7 +108,7 @@ case res of Nothing -> return Nothing Just vals ->- case fromPersistValues vals of+ case fromPersistValues $ if noColumns then [] else vals of Left e -> error $ "get " ++ show (unKey k) ++ ": " ++ unpack e Right v -> return $ Just v
persistent.cabal view
@@ -1,5 +1,5 @@ name: persistent-version: 1.3.0.5+version: 1.3.0.6 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>