packages feed

postgresql-simple-url 0.1.0.1 → 0.2.0.0

raw patch · 5 files changed

+29/−17 lines, 5 filesdep ~basedep ~tasty-quickcheckPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, tasty-quickcheck

API changes (from Hackage documentation)

Files

− .gitignore
@@ -1,4 +0,0 @@-dist/--cabal.sandbox.config-.cabal-sandbox/
+ CHANGELOG.md view
@@ -0,0 +1,4 @@+# 0.2.0.0++Allow empty host, i.e. don't use default provided by `postgresql-simple`.+Empty host is required to use unix domain sockets.
postgresql-simple-url.cabal view
@@ -1,6 +1,9 @@ name:                postgresql-simple-url-version:             0.1.0.1-synopsis:            PostgreSQL+version:             0.2.0.0+synopsis:            Parse postgres:// url into ConnectInfo+description:+  The 'Database.PostgreSQL.Simple.URL' module in this package exports+  two helper functions 'parseDatabaseUrl' and 'urlToConnectInfo'. homepage:            https://github.com/futurice/postgresql-simple-url license:             MIT license-file:        LICENSE@@ -10,15 +13,19 @@ stability:           experimental category:            Game build-type:          Simple-extra-source-files:  README.md, .gitignore+extra-source-files:  README.md, CHANGELOG.md cabal-version:       >=1.10 +source-repository head+  type: git+  location: https://github.com/futurice/postgresql-simple-url+ library   exposed-modules:     Database.PostgreSQL.Simple.URL-  build-depends:       base               >=4.6 && <4.9,+  build-depends:       base               >=4.6 && <4.10,                        split              >=0.2 && <0.3,                        network-uri        >=2.6 && <2.7,-                       postgresql-simple  >=0.4 && <0.5+                       postgresql-simple  >=0.4 && <0.6   hs-source-dirs:      src   ghc-options:         -Wall   default-language:    Haskell2010@@ -29,8 +36,8 @@   hs-source-dirs:      tests   main-is:             Tests.hs   ghc-options:         -Wall-  build-depends:       base               >=4.6  && <4.9,-                       tasty              >=0.10 && <0.11,+  build-depends:       base               >=4.6  && <4.10,+                       tasty              >=0.10 && <0.12,                        tasty-quickcheck   >=0.8  && <0.9,-                       postgresql-simple  >=0.4 && <0.5,+                       postgresql-simple  >=0.4 && <0.6,                        postgresql-simple-url
src/Database/PostgreSQL/Simple/URL.hs view
@@ -13,13 +13,13 @@ import Data.List.Split import Database.PostgreSQL.Simple import Network.URI+import Prelude  -- | Parse string url into `ConnectInfo`.--- +-- -- > parseDatabaseURL "postgres://foo:bar@example.com:2345/database" == ConnectInfo "example.com" 2345 "foo" "bar" "database" parseDatabaseUrl :: String -> Maybe ConnectInfo parseDatabaseUrl databaseUrl = parseURI databaseUrl >>= uriToConnectInfo-  where   uriToConnectInfo :: URI -> Maybe ConnectInfo uriToConnectInfo uri@@ -47,7 +47,6 @@                  (':' : p) -> \info -> info { connectPort = read p }                  _         -> id         host = case uriRegName uriAuth of-                 "" -> id                  h  -> \info -> info { connectHost = h }         auth = case splitOn ":" (uriUserInfo uriAuth) of                  [""]   -> id
tests/Tests.hs view
@@ -9,9 +9,15 @@  cases :: [(String, Maybe ConnectInfo)] cases =-  [ ("postgres:///local", Just $ defaultConnectInfo { connectDatabase = "local"} )+  [ ("postgres:///local", Just $ defaultConnectInfo+    { connectHost = "", connectDatabase = "local"} )+  , ("postgres://localhost/local", Just $ defaultConnectInfo+    { connectHost = "localhost", connectDatabase = "local"} )+  , ("postgres://user@/local", Just $ defaultConnectInfo+    { connectHost = "", connectUser = "user", connectDatabase = "local"} )   , ("mysql:///typo", Nothing)-  , ("postgres://foo:bar@example.com:2345/database", Just $ ConnectInfo "example.com" 2345 "foo" "bar" "database")+  , ("postgres://foo:bar@example.com:2345/database", Just $+    ConnectInfo "example.com" 2345 "foo" "bar" "database")   ]  casesProps :: TestTree