From a32f0c3234cd57d71f4eeab2b6849cb00fd484c8 Mon Sep 17 00:00:00 2001 From: Tony Hannan Date: Tue, 22 Feb 2011 10:31:54 -0500 Subject: [PATCH] Make Database.MongoDB.Connection compatible on Windows by not using PortID's UnixSocket constructor unless compiling on Unix --- Database/MongoDB/Connection.hs | 4 +++- TODO | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Database/MongoDB/Connection.hs b/Database/MongoDB/Connection.hs index 2f5f07c..2b6c45e 100644 --- a/Database/MongoDB/Connection.hs +++ b/Database/MongoDB/Connection.hs @@ -1,6 +1,6 @@ {- | A pool of TCP connections to a single server or a replica set of servers. -} -{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, RecordWildCards, NamedFieldPuns, MultiParamTypeClasses, FlexibleContexts, TypeFamilies, DoRec, RankNTypes, FlexibleInstances #-} +{-# LANGUAGE CPP, OverloadedStrings, ScopedTypeVariables, RecordWildCards, NamedFieldPuns, MultiParamTypeClasses, FlexibleContexts, TypeFamilies, DoRec, RankNTypes, FlexibleInstances #-} module Database.MongoDB.Connection ( -- * Pipe @@ -70,7 +70,9 @@ showHostPort :: Host -> String showHostPort (Host hostname port) = hostname ++ ":" ++ (case port of Service s -> s PortNumber p -> show p +#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) && !defined(_WIN32) UnixSocket s -> s) +#endif readHostPortM :: (Monad m) => String -> m Host -- ^ Read string \"hostname:port\" as @Host hosthame port@ or \"hostname\" as @host hostname@ (default port). Fail if string does not match either syntax. diff --git a/TODO b/TODO index fdb67e1..b67460b 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,7 @@ Bson MongoDB ------- ++ Support the new query flag: https://jira.mongodb.org/browse/SERVER-2020 + Support MapReduce 1.8 version + When one connection in a pool fails, close all other since they will likely fail too + on insert/update: reject keys that start with "$" or "."