Skip to content

Commit

Permalink
Move away from experimental conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Jan 26, 2024
1 parent afab914 commit 658bfe9
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 108 deletions.
40 changes: 20 additions & 20 deletions hasql.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,26 @@ library
Hasql.Statement

other-modules:
Hasql.Private.Commands
Hasql.Private.Connection
Hasql.Private.Decoders
Hasql.Private.Decoders.Array
Hasql.Private.Decoders.Composite
Hasql.Private.Decoders.Result
Hasql.Private.Decoders.Results
Hasql.Private.Decoders.Row
Hasql.Private.Decoders.Value
Hasql.Private.Encoders
Hasql.Private.Encoders.Array
Hasql.Private.Encoders.Params
Hasql.Private.Encoders.Value
Hasql.Private.Errors
Hasql.Private.IO
Hasql.Private.Prelude
Hasql.Private.PreparedStatementRegistry
Hasql.Private.PTI
Hasql.Private.Session
Hasql.Private.Settings
Hasql.Commands
Hasql.Connection.Core
Hasql.Decoders.All
Hasql.Decoders.Array
Hasql.Decoders.Composite
Hasql.Decoders.Result
Hasql.Decoders.Results
Hasql.Decoders.Row
Hasql.Decoders.Value
Hasql.Encoders.All
Hasql.Encoders.Array
Hasql.Encoders.Params
Hasql.Encoders.Value
Hasql.Errors
Hasql.IO
Hasql.Prelude
Hasql.PreparedStatementRegistry
Hasql.PTI
Hasql.Session.Core
Hasql.Settings

build-depends:
, aeson >=2 && <3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Hasql.Private.Commands
module Hasql.Commands
( Commands,
asBytes,
setEncodersToUTF8,
Expand All @@ -8,7 +8,7 @@ where

import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Hasql.Private.Prelude
import Hasql.Prelude

newtype Commands
= Commands (DList BB.Builder)
Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/Connection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module Hasql.Connection
)
where

import Hasql.Private.Connection
import Hasql.Private.Settings
import Hasql.Connection.Core
import Hasql.Settings
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- |
-- This module provides a low-level effectful API dealing with the connections to the database.
module Hasql.Private.Connection where
module Hasql.Connection.Core where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.IO as IO
import Hasql.Private.Prelude
import qualified Hasql.Private.PreparedStatementRegistry as PreparedStatementRegistry
import qualified Hasql.Private.Settings as Settings
import qualified Hasql.IO as IO
import Hasql.Prelude
import qualified Hasql.PreparedStatementRegistry as PreparedStatementRegistry
import qualified Hasql.Settings as Settings

-- |
-- A single connection to the database.
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Decoders.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ module Hasql.Decoders
)
where

import Hasql.Private.Decoders
import Hasql.Decoders.All
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
-- |
-- A DSL for declaration of result decoders.
module Hasql.Private.Decoders where
module Hasql.Decoders.All where

import qualified Data.Aeson as Aeson
import qualified Data.Vector.Generic as GenericVector
import qualified Hasql.Private.Decoders.Array as Array
import qualified Hasql.Private.Decoders.Composite as Composite
import qualified Hasql.Private.Decoders.Result as Result
import qualified Hasql.Private.Decoders.Results as Results
import qualified Hasql.Private.Decoders.Row as Row
import qualified Hasql.Private.Decoders.Value as Value
import Hasql.Private.Prelude hiding (bool, maybe)
import qualified Hasql.Private.Prelude as Prelude
import qualified Hasql.Decoders.Array as Array
import qualified Hasql.Decoders.Composite as Composite
import qualified Hasql.Decoders.Result as Result
import qualified Hasql.Decoders.Results as Results
import qualified Hasql.Decoders.Row as Row
import qualified Hasql.Decoders.Value as Value
import Hasql.Prelude hiding (bool, maybe)
import qualified Hasql.Prelude as Prelude
import qualified Network.IP.Addr as NetworkIp
import qualified PostgreSQL.Binary.Decoding as A

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Hasql.Private.Decoders.Array where
module Hasql.Decoders.Array where

import Hasql.Private.Prelude
import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A

newtype Array a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Hasql.Private.Decoders.Composite where
module Hasql.Decoders.Composite where

import Hasql.Private.Prelude
import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A

newtype Composite a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Hasql.Private.Decoders.Result where
module Hasql.Decoders.Result where

import qualified Data.Attoparsec.ByteString.Char8 as Attoparsec
import qualified Data.ByteString as ByteString
import qualified Data.Vector as Vector
import qualified Data.Vector.Mutable as MutableVector
import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.Decoders.Row as Row
import Hasql.Private.Errors
import Hasql.Private.Prelude hiding (many, maybe)
import qualified Hasql.Private.Prelude as Prelude
import qualified Hasql.Decoders.Row as Row
import Hasql.Errors
import Hasql.Prelude hiding (many, maybe)
import qualified Hasql.Prelude as Prelude

newtype Result a
= Result (ReaderT (Bool, LibPQ.Result) (ExceptT ResultError IO) a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
-- with the help of "Applicative" and "Monad",
--
-- * Row-by-row fetching.
module Hasql.Private.Decoders.Results where
module Hasql.Decoders.Results where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.Decoders.Result as Result
import Hasql.Private.Errors
import Hasql.Private.Prelude hiding (many, maybe)
import qualified Hasql.Private.Prelude as Prelude
import qualified Hasql.Decoders.Result as Result
import Hasql.Errors
import Hasql.Prelude hiding (many, maybe)
import qualified Hasql.Prelude as Prelude

newtype Results a
= Results (ReaderT (Bool, LibPQ.Connection) (ExceptT CommandError IO) a)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Hasql.Private.Decoders.Row where
module Hasql.Decoders.Row where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.Decoders.Value as Value
import Hasql.Private.Errors
import Hasql.Private.Prelude hiding (error)
import qualified Hasql.Decoders.Value as Value
import Hasql.Errors
import Hasql.Prelude hiding (error)
import qualified PostgreSQL.Binary.Decoding as A

newtype Row a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Hasql.Private.Decoders.Value where
module Hasql.Decoders.Value where

import Hasql.Private.Prelude
import Hasql.Prelude
import qualified PostgreSQL.Binary.Decoding as A

newtype Value a
Expand Down
2 changes: 1 addition & 1 deletion library/Hasql/Encoders.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ module Hasql.Encoders
)
where

import Hasql.Private.Encoders
import Hasql.Encoders.All
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- |
-- A DSL for declaration of query parameter encoders.
module Hasql.Private.Encoders where
module Hasql.Encoders.All where

import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Hasql.Private.Encoders.Array as Array
import qualified Hasql.Private.Encoders.Params as Params
import qualified Hasql.Private.Encoders.Value as Value
import qualified Hasql.Private.PTI as PTI
import Hasql.Private.Prelude hiding (bool)
import qualified Hasql.Private.Prelude as Prelude
import qualified Hasql.Encoders.Array as Array
import qualified Hasql.Encoders.Params as Params
import qualified Hasql.Encoders.Value as Value
import qualified Hasql.PTI as PTI
import Hasql.Prelude hiding (bool)
import qualified Hasql.Prelude as Prelude
import qualified Network.IP.Addr as NetworkIp
import qualified PostgreSQL.Binary.Encoding as A
import qualified Text.Builder as C
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Private.Encoders.Array where
module Hasql.Encoders.Array where

import qualified Hasql.Private.PTI as B
import Hasql.Private.Prelude
import qualified Hasql.PTI as B
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as A
import qualified Text.Builder as C

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Hasql.Private.Encoders.Params where
module Hasql.Encoders.Params where

import qualified Database.PostgreSQL.LibPQ as A
import qualified Hasql.Private.Encoders.Value as C
import qualified Hasql.Private.PTI as D
import Hasql.Private.Prelude
import qualified Hasql.Encoders.Value as C
import qualified Hasql.PTI as D
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as B
import qualified Text.Builder as E

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Private.Encoders.Value where
module Hasql.Encoders.Value where

import qualified Hasql.Private.PTI as PTI
import Hasql.Private.Prelude
import qualified Hasql.PTI as PTI
import Hasql.Prelude
import qualified PostgreSQL.Binary.Encoding as B
import qualified Text.Builder as C

Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/Private/Errors.hs → library/Hasql/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
-- with the help of "Applicative" and "Monad",
--
-- * Row-by-row fetching.
module Hasql.Private.Errors where
module Hasql.Errors where

import qualified Data.ByteString.Char8 as BC
import Hasql.Private.Prelude
import Hasql.Prelude

-- |
-- An error during the execution of a query.
Expand Down
16 changes: 8 additions & 8 deletions library/Hasql/Private/IO.hs → library/Hasql/IO.hs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- |
-- An API of low-level IO operations.
module Hasql.Private.IO where
module Hasql.IO where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.Commands as Commands
import qualified Hasql.Private.Decoders.Result as ResultDecoders
import qualified Hasql.Private.Decoders.Results as ResultsDecoders
import qualified Hasql.Private.Encoders.Params as ParamsEncoders
import Hasql.Private.Errors
import Hasql.Private.Prelude
import qualified Hasql.Private.PreparedStatementRegistry as PreparedStatementRegistry
import qualified Hasql.Commands as Commands
import qualified Hasql.Decoders.Result as ResultDecoders
import qualified Hasql.Decoders.Results as ResultsDecoders
import qualified Hasql.Encoders.Params as ParamsEncoders
import Hasql.Errors
import Hasql.Prelude
import qualified Hasql.PreparedStatementRegistry as PreparedStatementRegistry

{-# INLINE acquireConnection #-}
acquireConnection :: ByteString -> IO LibPQ.Connection
Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/Private/PTI.hs → library/Hasql/PTI.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hasql.Private.PTI where
module Hasql.PTI where

import qualified Database.PostgreSQL.LibPQ as LibPQ
import Hasql.Private.Prelude hiding (bool)
import Hasql.Prelude hiding (bool)

-- | A Postgresql type info
data PTI = PTI {ptiOID :: !OID, ptiArrayOID :: !(Maybe OID)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Hasql.Private.Prelude
module Hasql.Prelude
( module Exports,
LazyByteString,
ByteStringBuilder,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Hasql.Private.PreparedStatementRegistry
module Hasql.PreparedStatementRegistry
( PreparedStatementRegistry,
new,
update,
Expand All @@ -8,7 +8,7 @@ where

import qualified ByteString.StrictBuilder as B
import qualified Data.HashTable.IO as A
import Hasql.Private.Prelude hiding (lookup)
import Hasql.Prelude hiding (lookup)

data PreparedStatementRegistry
= PreparedStatementRegistry !(A.BasicHashTable LocalKey ByteString) !(IORef Word)
Expand Down
6 changes: 3 additions & 3 deletions library/Hasql/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module Hasql.Session
run,

-- * Errors
module Hasql.Private.Errors,
module Hasql.Errors,
)
where

import Hasql.Private.Errors
import Hasql.Private.Session
import Hasql.Errors
import Hasql.Session.Core
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Hasql.Private.Session where
module Hasql.Session.Core where

import qualified Hasql.Private.Connection as Connection
import qualified Hasql.Private.Decoders.Result as Decoders.Result
import qualified Hasql.Private.Decoders.Results as Decoders.Results
import qualified Hasql.Private.Encoders as Encoders
import qualified Hasql.Private.Encoders.Params as Encoders.Params
import Hasql.Private.Errors
import qualified Hasql.Private.IO as IO
import Hasql.Private.Prelude
import qualified Hasql.Connection.Core as Connection
import qualified Hasql.Decoders.Result as Decoders.Result
import qualified Hasql.Decoders.Results as Decoders.Results
import qualified Hasql.Encoders.All as Encoders
import qualified Hasql.Encoders.Params as Encoders.Params
import Hasql.Errors
import qualified Hasql.IO as IO
import Hasql.Prelude
import qualified Hasql.Statement as Statement

-- |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Hasql.Private.Settings where
module Hasql.Settings where

import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
import Hasql.Private.Prelude
import Hasql.Prelude

-- |
-- All settings encoded in a single byte-string according to
Expand Down
4 changes: 2 additions & 2 deletions library/Hasql/Statement.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ module Hasql.Statement
where

import qualified Hasql.Decoders as Decoders
import qualified Hasql.Decoders.All as Decoders
import qualified Hasql.Encoders as Encoders
import qualified Hasql.Private.Decoders as Decoders
import Hasql.Private.Prelude
import Hasql.Prelude

-- |
-- Specification of a strictly single-statement query, which can be parameterized and prepared.
Expand Down

0 comments on commit 658bfe9

Please sign in to comment.