Skip to content

Update deps, fix warnings #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dependencies": {
"purescript-arrays": "~0.4.0",
"purescript-either": "~0.2.0",
"purescript-foreign": "~0.5.0",
"purescript-foreign": "~0.7.0",
"purescript-foldable-traversable": "~0.4.0",
"purescript-transformers": "~0.6.0",
"purescript-aff": "~0.11.0",
"purescript-transformers": "~0.8.0",
"purescript-aff": "~0.16.0",
"purescript-integers": "~0.2.0"
}
}
27 changes: 12 additions & 15 deletions src/Database/Postgres.purs
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@ module Database.Postgres
) where

import Prelude
import Control.Alt
import Control.Apply ((*>))
import Control.Monad.Eff
import Control.Monad.Trans
import Data.Either
import Control.Monad.Eff (Eff)
import Data.Either (either)
import Data.Function (Fn2(), runFn2)
import Data.Array
import Data.Foreign
import Data.Foreign.Class
import Data.Maybe
import Control.Monad.Aff
import Control.Monad.Eff.Class
import Control.Monad.Eff.Exception(Error(), error)
import Control.Monad.Error.Class (throwError, catchError)
import Data.Array ((!!))
import Data.Foreign (Foreign, ForeignError)
import Data.Foreign.Class (class IsForeign, read)
import Data.Maybe (Maybe(Just, Nothing), maybe)
import Control.Monad.Aff (Aff, finally)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Exception (error)
import Control.Monad.Error.Class (throwError)
import Data.Traversable (sequence)

import Database.Postgres.SqlValue
import Database.Postgres.SqlValue (SqlValue)

newtype Query a = Query String

Expand Down Expand Up @@ -73,7 +70,7 @@ execute_ :: forall eff a. Query a -> Client -> Aff (db :: DB | eff) Unit
execute_ (Query sql) client = void $ runQuery_ sql client

-- | Runs a query and returns all results.
query :: forall eff a p
query :: forall eff a
. (IsForeign a)
=> Query a -> Array SqlValue -> Client -> Aff (db :: DB | eff) (Array a)
query (Query sql) params client = do
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Postgres/SqlValue.purs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module Database.Postgres.SqlValue
( SqlValue()
, IsSqlValue
, class IsSqlValue
, toSql
) where

import Prelude ((<<<))
import Data.Int
import Data.Maybe
import Data.Int (toNumber)
import Data.Maybe (Maybe(..))

foreign import data SqlValue :: *

Expand Down
7 changes: 3 additions & 4 deletions src/Database/Postgres/Transaction.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ module Database.Postgres.Transaction where

import Prelude
import Control.Apply ((*>))
import Control.Monad.Aff
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Error.Class (throwError)
import Data.Either
import Data.Either (either)

import Database.Postgres
import Database.Postgres.SqlValue
import Database.Postgres (DB, Client, Query(Query), execute_)

-- | Runs an asynchronous action in a database transaction. The transaction
-- | will be rolled back if the computation fails and committed otherwise.
Expand Down