From e344b2c0042fa4a9e0261c4814c2383389a28511 Mon Sep 17 00:00:00 2001 From: Tomasz Rybarczyk Date: Mon, 8 Nov 2021 20:19:24 +0100 Subject: [PATCH] Update deps --- bower.json | 13 +++--- packages.dhall | 12 ++--- src/Database/PostgreSQL.purs | 88 ++++++++++++++---------------------- 3 files changed, 47 insertions(+), 66 deletions(-) diff --git a/bower.json b/bower.json index ce99fb0..07f189f 100644 --- a/bower.json +++ b/bower.json @@ -42,18 +42,17 @@ "purescript-nullable": "^v5.0.0", "purescript-ordered-collections": "^v2.0.1", "purescript-partial": "^v3.0.0", - "purescript-polyform": "updateTov0.14.1", - "purescript-polyform-batteries-core": "updateTov0.14.1", - "purescript-polyform-batteries-env": "updateTov0.14.1", + "purescript-polyform": "^v0.9.0", + "purescript-polyform-batteries-core": "https://github.com/purescript-polyform/batteries-core.git#v0.2.0", + "purescript-polyform-batteries-env": "https://github.com/purescript-polyform/batteries-env.git#v0.1.0", "purescript-prelude": "^v5.0.0", + "purescript-psci-support": "^v5.0.0", "purescript-string-parsers": "^v6.0.0", + "purescript-strings": "^v5.0.0", + "purescript-test-unit": "^v16.0.0", "purescript-transformers": "^v5.1.0", "purescript-tuples": "^v6.0.1", "purescript-typelevel-prelude": "^v6.0.0", "purescript-validation": "^v5.0.0" - }, - "devDependencies": { - "purescript-psci-support": "^v5.0.0", - "purescript-test-unit": "^v16.0.0" } } diff --git a/packages.dhall b/packages.dhall index 5f99d03..afcf715 100644 --- a/packages.dhall +++ b/packages.dhall @@ -31,8 +31,8 @@ in upstream , "validation" , "variant" ] - , repo = "https://github.com/jordanmartinez/purescript-polyform.git" - , version = "updateTov0.14.1" + , repo = "https://github.com/purescript-polyform/polyform.git" + , version = "v0.9.0" } with polyform-batteries-core = { dependencies = @@ -55,8 +55,8 @@ in upstream , "validation" , "variant" ] - , repo = "https://github.com/jordanmartinez/purescript-polyform-validators.git" - , version = "updateTov0.14.1" + , repo = "https://github.com/purescript-polyform/batteries-core.git" + , version = "v0.2.0" } with polyform-batteries-env = { dependencies = @@ -70,6 +70,6 @@ in upstream , "psci-support" , "typelevel-prelude" ] - , repo = "https://github.com/jordanmartinez/batteries-env.git" - , version = "updateTov0.14.1" + , repo = "https://github.com/purescript-polyform/batteries-env.git" + , version = "v0.1.0" } diff --git a/src/Database/PostgreSQL.purs b/src/Database/PostgreSQL.purs index 3e85446..ac4bd27 100644 --- a/src/Database/PostgreSQL.purs +++ b/src/Database/PostgreSQL.purs @@ -17,7 +17,6 @@ module Database.PostgreSQL ) where import Prelude - import Control.Monad.Error.Class (catchError, throwError) import Data.Array (head) import Data.Bifunctor (lmap) @@ -249,59 +248,42 @@ convertError err = case toMaybe $ ffiSQLState err of convert s = if prefix "0A" s then NotSupportedError + else if prefix "20" s || prefix "21" s then + ProgrammingError + else if prefix "22" s then + DataError + else if prefix "23" s then + IntegrityError + else if prefix "24" s || prefix "25" s then + InternalError + else if prefix "26" s || prefix "27" s || prefix "28" s then + OperationalError + else if prefix "2B" s || prefix "2D" s || prefix "2F" s then + InternalError + else if prefix "34" s then + OperationalError + else if prefix "38" s || prefix "39" s || prefix "3B" s then + InternalError + else if prefix "3D" s || prefix "3F" s then + ProgrammingError + else if prefix "40" s then + TransactionRollbackError + else if prefix "42" s || prefix "44" s then + ProgrammingError + else if s == "57014" then + QueryCanceledError + else if prefix "5" s then + OperationalError + else if prefix "F" s then + InternalError + else if prefix "H" s then + OperationalError + else if prefix "P" s then + InternalError + else if prefix "X" s then + InternalError else - if prefix "20" s || prefix "21" s then - ProgrammingError - else - if prefix "22" s then - DataError - else - if prefix "23" s then - IntegrityError - else - if prefix "24" s || prefix "25" s then - InternalError - else - if prefix "26" s || prefix "27" s || prefix "28" s then - OperationalError - else - if prefix "2B" s || prefix "2D" s || prefix "2F" s then - InternalError - else - if prefix "34" s then - OperationalError - else - if prefix "38" s || prefix "39" s || prefix "3B" s then - InternalError - else - if prefix "3D" s || prefix "3F" s then - ProgrammingError - else - if prefix "40" s then - TransactionRollbackError - else - if prefix "42" s || prefix "44" s then - ProgrammingError - else - if s == "57014" then - QueryCanceledError - else - if prefix "5" s then - OperationalError - else - if prefix "F" s then - InternalError - else - if prefix "H" s then - OperationalError - else - if prefix "P" s then - InternalError - else - if prefix "X" s then - InternalError - else - const $ ConnectionError s + const $ ConnectionError s prefix :: String -> String -> Boolean prefix p = maybe false (_ == 0) <<< String.indexOf (Pattern p)