pqi-native 0.2.0.5 → 1.0.0.0
raw patch · 3 files changed
+27/−4 lines, 3 filesdep ~pqidep ~pqi-conformancePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: pqi, pqi-conformance
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- pqi-native.cabal +3/−3
- src/library/Pqi/Native.hs +18/−1
CHANGELOG.md view
@@ -1,3 +1,9 @@+# v1.0.0.0++## Non-breaking++- Support for the `resStatus` field of `Pqi.Adapter`+ # v0.2.0.5 ## Fixes
pqi-native.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: pqi-native-version: 0.2.0.5+version: 1.0.0.0 category: Database, PostgreSQL synopsis: Native (pure-Haskell) adapter for pqi description:@@ -139,7 +139,7 @@ bytestring >=0.10 && <0.13, containers >=0.6 && <0.9, crypton >=0.34 && <2,- pqi ^>=0.1,+ pqi ^>=1.0, pqi-native:transport, ptr-peeker ^>=0.2, ptr-poker ^>=0.1.3,@@ -153,5 +153,5 @@ build-depends: base >=4.11 && <5, hspec >=2.11 && <2.12,- pqi-conformance ^>=0.1.1,+ pqi-conformance ^>=1.0, pqi-native,
src/library/Pqi/Native.hs view
@@ -39,8 +39,25 @@ Pqi.connectdb = \conninfo -> mkConnection <$> Connection.establish conninfo, Pqi.connectStart = \conninfo -> mkConnection <$> Connection.establish conninfo, Pqi.newNullConnection = mkConnection <$> Connection.nullConnection,- Pqi.unescapeBytea = \input -> pure (Just (UnescapeBytea.unescapeBytea input))+ Pqi.unescapeBytea = \input -> pure (Just (UnescapeBytea.unescapeBytea input)),+ Pqi.resStatus = pure . resStatus }++-- | The string libpq's @PQresStatus@ describes each status code with.+resStatus :: Pqi.ExecStatus -> ByteString+resStatus = \case+ Pqi.EmptyQuery -> "PGRES_EMPTY_QUERY"+ Pqi.CommandOk -> "PGRES_COMMAND_OK"+ Pqi.TuplesOk -> "PGRES_TUPLES_OK"+ Pqi.CopyOut -> "PGRES_COPY_OUT"+ Pqi.CopyIn -> "PGRES_COPY_IN"+ Pqi.CopyBoth -> "PGRES_COPY_BOTH"+ Pqi.BadResponse -> "PGRES_BAD_RESPONSE"+ Pqi.NonfatalError -> "PGRES_NONFATAL_ERROR"+ Pqi.FatalError -> "PGRES_FATAL_ERROR"+ Pqi.SingleTuple -> "PGRES_SINGLE_TUPLE"+ Pqi.PipelineSync -> "PGRES_PIPELINE_SYNC"+ Pqi.PipelineAbort -> "PGRES_PIPELINE_ABORTED" -- | Build a 'Pqi.Connection' whose fields close over the given native -- connection.