From 04058b4b9937df25ed11a51abd57a9c4745e86c8 Mon Sep 17 00:00:00 2001 From: VyacheslavHashov Date: Sat, 28 Jan 2017 00:50:38 +0300 Subject: [PATCH] Moved to Driver directory --- postgres-wire.cabal | 11 ++++++----- src/Database/PostgreSQL/Driver.hs | 2 ++ .../PostgreSQL/{ => Driver}/Connection.hs | 17 ++++------------- .../PostgreSQL/{ => Driver}/Settings.hs | 2 +- .../PostgreSQL/{ => Driver}/StatementStorage.hs | 2 +- src/Database/PostgreSQL/{ => Driver}/Types.hs | 2 +- src/Database/PostgreSQL/Protocol.hs | 2 -- 7 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 src/Database/PostgreSQL/Driver.hs rename src/Database/PostgreSQL/{ => Driver}/Connection.hs (96%) rename src/Database/PostgreSQL/{ => Driver}/Settings.hs (95%) rename src/Database/PostgreSQL/{ => Driver}/StatementStorage.hs (93%) rename src/Database/PostgreSQL/{ => Driver}/Types.hs (92%) delete mode 100644 src/Database/PostgreSQL/Protocol.hs diff --git a/postgres-wire.cabal b/postgres-wire.cabal index 1ac8722..67c9500 100644 --- a/postgres-wire.cabal +++ b/postgres-wire.cabal @@ -15,11 +15,11 @@ cabal-version: >=1.10 library hs-source-dirs: src - exposed-modules: Database.PostgreSQL.Protocol - , Database.PostgreSQL.Connection - , Database.PostgreSQL.Settings - , Database.PostgreSQL.StatementStorage - , Database.PostgreSQL.Types + exposed-modules: Database.PostgreSQL.Driver + , Database.PostgreSQL.Driver.Connection + , Database.PostgreSQL.Driver.Settings + , Database.PostgreSQL.Driver.StatementStorage + , Database.PostgreSQL.Driver.Types , Database.PostgreSQL.Protocol.Types , Database.PostgreSQL.Protocol.Encoders @@ -42,6 +42,7 @@ library default-language: Haskell2010 default-extensions: OverloadedStrings + OverloadedLists GeneralizedNewtypeDeriving test-suite postgres-wire-test diff --git a/src/Database/PostgreSQL/Driver.hs b/src/Database/PostgreSQL/Driver.hs new file mode 100644 index 0000000..d16221f --- /dev/null +++ b/src/Database/PostgreSQL/Driver.hs @@ -0,0 +1,2 @@ +module Database.PostgreSQL.Driver where + diff --git a/src/Database/PostgreSQL/Connection.hs b/src/Database/PostgreSQL/Driver/Connection.hs similarity index 96% rename from src/Database/PostgreSQL/Connection.hs rename to src/Database/PostgreSQL/Driver/Connection.hs index d2ed08a..34277ad 100644 --- a/src/Database/PostgreSQL/Connection.hs +++ b/src/Database/PostgreSQL/Driver/Connection.hs @@ -1,11 +1,4 @@ -{-# language OverloadedLists #-} -{-# language OverloadedStrings #-} -{-# language GADTs #-} -{-# language ApplicativeDo #-} -{-# language ExistentialQuantification #-} -{-# language TypeSynonymInstances #-} -{-# language FlexibleInstances #-} -module Database.PostgreSQL.Connection where +module Database.PostgreSQL.Driver.Connection where import qualified Data.ByteString as B @@ -34,13 +27,11 @@ import Crypto.Hash (hash, Digest, MD5) import Database.PostgreSQL.Protocol.Encoders import Database.PostgreSQL.Protocol.Decoders import Database.PostgreSQL.Protocol.Types -import Database.PostgreSQL.Settings -import Database.PostgreSQL.StatementStorage -import Database.PostgreSQL.Types +import Database.PostgreSQL.Driver.Settings +import Database.PostgreSQL.Driver.StatementStorage +import Database.PostgreSQL.Driver.Types -type UnixSocket = Socket Unix Stream Unix --- data Connection = Connection (Socket Inet6 Stream TCP) data Connection = Connection { connRawConnection :: RawConnection , connReceiverThread :: ThreadId diff --git a/src/Database/PostgreSQL/Settings.hs b/src/Database/PostgreSQL/Driver/Settings.hs similarity index 95% rename from src/Database/PostgreSQL/Settings.hs rename to src/Database/PostgreSQL/Driver/Settings.hs index 09da224..d70c44d 100644 --- a/src/Database/PostgreSQL/Settings.hs +++ b/src/Database/PostgreSQL/Driver/Settings.hs @@ -1,6 +1,6 @@ {-# language OverloadedStrings #-} -module Database.PostgreSQL.Settings where +module Database.PostgreSQL.Driver.Settings where import Data.Word (Word16) import Data.ByteString (ByteString) diff --git a/src/Database/PostgreSQL/StatementStorage.hs b/src/Database/PostgreSQL/Driver/StatementStorage.hs similarity index 93% rename from src/Database/PostgreSQL/StatementStorage.hs rename to src/Database/PostgreSQL/Driver/StatementStorage.hs index b27ce7c..3551e6f 100644 --- a/src/Database/PostgreSQL/StatementStorage.hs +++ b/src/Database/PostgreSQL/Driver/StatementStorage.hs @@ -1,4 +1,4 @@ -module Database.PostgreSQL.StatementStorage where +module Database.PostgreSQL.Driver.StatementStorage where import qualified Data.HashTable.IO as H import qualified Data.ByteString as B diff --git a/src/Database/PostgreSQL/Types.hs b/src/Database/PostgreSQL/Driver/Types.hs similarity index 92% rename from src/Database/PostgreSQL/Types.hs rename to src/Database/PostgreSQL/Driver/Types.hs index f62c3e0..09d8fbd 100644 --- a/src/Database/PostgreSQL/Types.hs +++ b/src/Database/PostgreSQL/Driver/Types.hs @@ -1,7 +1,7 @@ {- * We dont store parameters of connection that may change after startup -} -module Database.PostgreSQL.Types where +module Database.PostgreSQL.Driver.Types where import Data.ByteString (ByteString) diff --git a/src/Database/PostgreSQL/Protocol.hs b/src/Database/PostgreSQL/Protocol.hs deleted file mode 100644 index 8d0c798..0000000 --- a/src/Database/PostgreSQL/Protocol.hs +++ /dev/null @@ -1,2 +0,0 @@ -module Database.PostgreSQL.Protocol where -