refactor: move DbStructure.PgVersion to Config
Now that PgVersion is not part of DbStructure, Config is a more apt module for it. Also rename getDbStructure to queryDbStructure. AppState also had a getDbStructure function for a record field.
This commit is contained in:
committed by
Steve Chavez
parent
823348a72a
commit
f169661ce6
+1
-1
@@ -41,11 +41,11 @@ library
|
|||||||
PostgREST.Config
|
PostgREST.Config
|
||||||
PostgREST.Config.Database
|
PostgREST.Config.Database
|
||||||
PostgREST.Config.JSPath
|
PostgREST.Config.JSPath
|
||||||
|
PostgREST.Config.PgVersion
|
||||||
PostgREST.Config.Proxy
|
PostgREST.Config.Proxy
|
||||||
PostgREST.ContentType
|
PostgREST.ContentType
|
||||||
PostgREST.DbStructure
|
PostgREST.DbStructure
|
||||||
PostgREST.DbStructure.Identifiers
|
PostgREST.DbStructure.Identifiers
|
||||||
PostgREST.DbStructure.PgVersion
|
|
||||||
PostgREST.DbStructure.Proc
|
PostgREST.DbStructure.Proc
|
||||||
PostgREST.DbStructure.Relationship
|
PostgREST.DbStructure.Relationship
|
||||||
PostgREST.DbStructure.Table
|
PostgREST.DbStructure.Table
|
||||||
|
|||||||
@@ -54,13 +54,13 @@ import qualified PostgREST.Request.DbRequestBuilder as ReqBuilder
|
|||||||
import PostgREST.AppState (AppState)
|
import PostgREST.AppState (AppState)
|
||||||
import PostgREST.Config (AppConfig (..),
|
import PostgREST.Config (AppConfig (..),
|
||||||
LogLevel (..))
|
LogLevel (..))
|
||||||
|
import PostgREST.Config.PgVersion (PgVersion (..))
|
||||||
import PostgREST.ContentType (ContentType (..))
|
import PostgREST.ContentType (ContentType (..))
|
||||||
import PostgREST.DbStructure (DbStructure (..),
|
import PostgREST.DbStructure (DbStructure (..),
|
||||||
tablePKCols)
|
tablePKCols)
|
||||||
import PostgREST.DbStructure.Identifiers (FieldName,
|
import PostgREST.DbStructure.Identifiers (FieldName,
|
||||||
QualifiedIdentifier (..),
|
QualifiedIdentifier (..),
|
||||||
Schema)
|
Schema)
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion (..))
|
|
||||||
import PostgREST.DbStructure.Proc (ProcDescription (..),
|
import PostgREST.DbStructure.Proc (ProcDescription (..),
|
||||||
ProcVolatility (..))
|
ProcVolatility (..))
|
||||||
import PostgREST.DbStructure.Table (Table (..))
|
import PostgREST.DbStructure.Table (Table (..))
|
||||||
|
|||||||
@@ -28,10 +28,9 @@ import Data.IORef (IORef, atomicWriteIORef, newIORef,
|
|||||||
readIORef)
|
readIORef)
|
||||||
import Data.Time.Clock (UTCTime, getCurrentTime)
|
import Data.Time.Clock (UTCTime, getCurrentTime)
|
||||||
|
|
||||||
import PostgREST.Config (AppConfig (..))
|
import PostgREST.Config (AppConfig (..))
|
||||||
import PostgREST.DbStructure (DbStructure)
|
import PostgREST.Config.PgVersion (PgVersion (..), minimumPgVersion)
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion (..),
|
import PostgREST.DbStructure (DbStructure)
|
||||||
minimumPgVersion)
|
|
||||||
|
|
||||||
import Protolude hiding (toS)
|
import Protolude hiding (toS)
|
||||||
import Protolude.Conv (toS)
|
import Protolude.Conv (toS)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import Text.Heredoc (str)
|
|||||||
|
|
||||||
import PostgREST.AppState (AppState)
|
import PostgREST.AppState (AppState)
|
||||||
import PostgREST.Config (AppConfig (..))
|
import PostgREST.Config (AppConfig (..))
|
||||||
import PostgREST.DbStructure (getDbStructure)
|
import PostgREST.DbStructure (queryDbStructure)
|
||||||
import PostgREST.Version (prettyVersion)
|
import PostgREST.Version (prettyVersion)
|
||||||
import PostgREST.Workers (reReadConfig)
|
import PostgREST.Workers (reReadConfig)
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ dumpSchema appState = do
|
|||||||
result <-
|
result <-
|
||||||
P.use (AppState.getPool appState) $
|
P.use (AppState.getPool appState) $
|
||||||
HT.transaction HT.ReadCommitted HT.Read $
|
HT.transaction HT.ReadCommitted HT.Read $
|
||||||
getDbStructure
|
queryDbStructure
|
||||||
(toList configDbSchemas)
|
(toList configDbSchemas)
|
||||||
configDbExtraSearchPath
|
configDbExtraSearchPath
|
||||||
configDbPreparedStatements
|
configDbPreparedStatements
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
|
||||||
module PostgREST.Config.Database
|
module PostgREST.Config.Database
|
||||||
( loadDbSettings
|
( queryDbSettings
|
||||||
|
, queryPgVersion
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import PostgREST.Config.PgVersion (PgVersion (..))
|
||||||
|
|
||||||
import qualified Hasql.Decoders as HD
|
import qualified Hasql.Decoders as HD
|
||||||
import qualified Hasql.Encoders as HE
|
import qualified Hasql.Encoders as HE
|
||||||
import qualified Hasql.Pool as P
|
import qualified Hasql.Pool as P
|
||||||
|
import qualified Hasql.Session as H
|
||||||
import qualified Hasql.Statement as H
|
import qualified Hasql.Statement as H
|
||||||
import qualified Hasql.Transaction as HT
|
import qualified Hasql.Transaction as HT
|
||||||
import qualified Hasql.Transaction.Sessions as HT
|
import qualified Hasql.Transaction.Sessions as HT
|
||||||
@@ -16,9 +20,14 @@ import Text.InterpolatedString.Perl6 (q)
|
|||||||
|
|
||||||
import Protolude hiding (hPutStrLn)
|
import Protolude hiding (hPutStrLn)
|
||||||
|
|
||||||
|
queryPgVersion :: H.Session PgVersion
|
||||||
|
queryPgVersion = H.statement mempty $ H.Statement sql HE.noParams versionRow False
|
||||||
|
where
|
||||||
|
sql = "SELECT current_setting('server_version_num')::integer, current_setting('server_version')"
|
||||||
|
versionRow = HD.singleRow $ PgVersion <$> column HD.int4 <*> column HD.text
|
||||||
|
|
||||||
loadDbSettings :: P.Pool -> IO [(Text, Text)]
|
queryDbSettings :: P.Pool -> IO [(Text, Text)]
|
||||||
loadDbSettings pool = do
|
queryDbSettings pool = do
|
||||||
result <-
|
result <-
|
||||||
P.use pool . HT.transaction HT.ReadCommitted HT.Read $
|
P.use pool . HT.transaction HT.ReadCommitted HT.Read $
|
||||||
HT.statement mempty dbSettingsStatement
|
HT.statement mempty dbSettingsStatement
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{-# LANGUAGE DeriveAnyClass #-}
|
{-# LANGUAGE DeriveAnyClass #-}
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
module PostgREST.DbStructure.PgVersion
|
module PostgREST.Config.PgVersion
|
||||||
( PgVersion(..)
|
( PgVersion(..)
|
||||||
, minimumPgVersion
|
, minimumPgVersion
|
||||||
, pgVersion95
|
, pgVersion95
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{-|
|
{-|
|
||||||
Module : PostgREST.Private.ProxyUri
|
Module : PostgREST.Private.ProxyUri
|
||||||
Description : Proxy Uri validator
|
Description : Proxy Uri validator
|
||||||
|
|||||||
@@ -20,11 +20,10 @@ These queries are executed once at startup or when PostgREST is reloaded.
|
|||||||
|
|
||||||
module PostgREST.DbStructure
|
module PostgREST.DbStructure
|
||||||
( DbStructure(..)
|
( DbStructure(..)
|
||||||
, getDbStructure
|
, queryDbStructure
|
||||||
, accessibleTables
|
, accessibleTables
|
||||||
, accessibleProcs
|
, accessibleProcs
|
||||||
, schemaDescription
|
, schemaDescription
|
||||||
, getPgVersion
|
|
||||||
, tableCols
|
, tableCols
|
||||||
, tablePKCols
|
, tablePKCols
|
||||||
) where
|
) where
|
||||||
@@ -34,7 +33,6 @@ import qualified Data.HashMap.Strict as M
|
|||||||
import qualified Data.List as L
|
import qualified Data.List as L
|
||||||
import qualified Hasql.Decoders as HD
|
import qualified Hasql.Decoders as HD
|
||||||
import qualified Hasql.Encoders as HE
|
import qualified Hasql.Encoders as HE
|
||||||
import qualified Hasql.Session as H
|
|
||||||
import qualified Hasql.Statement as H
|
import qualified Hasql.Statement as H
|
||||||
import qualified Hasql.Transaction as HT
|
import qualified Hasql.Transaction as HT
|
||||||
|
|
||||||
@@ -45,7 +43,6 @@ import Text.InterpolatedString.Perl6 (q)
|
|||||||
|
|
||||||
import PostgREST.DbStructure.Identifiers (QualifiedIdentifier (..),
|
import PostgREST.DbStructure.Identifiers (QualifiedIdentifier (..),
|
||||||
Schema, TableName)
|
Schema, TableName)
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion (..))
|
|
||||||
import PostgREST.DbStructure.Proc (PgArg (..), PgType (..),
|
import PostgREST.DbStructure.Proc (PgArg (..), PgType (..),
|
||||||
ProcDescription (..),
|
ProcDescription (..),
|
||||||
ProcVolatility (..),
|
ProcVolatility (..),
|
||||||
@@ -85,8 +82,8 @@ type ViewColumn = Column
|
|||||||
-- | A SQL query that can be executed independently
|
-- | A SQL query that can be executed independently
|
||||||
type SqlQuery = ByteString
|
type SqlQuery = ByteString
|
||||||
|
|
||||||
getDbStructure :: [Schema] -> [Schema] -> Bool -> HT.Transaction DbStructure
|
queryDbStructure :: [Schema] -> [Schema] -> Bool -> HT.Transaction DbStructure
|
||||||
getDbStructure schemas extraSearchPath prepared = do
|
queryDbStructure schemas extraSearchPath prepared = do
|
||||||
HT.sql "set local schema ''" -- This voids the search path. The following queries need this for getting the fully qualified name(schema.name) of every db object
|
HT.sql "set local schema ''" -- This voids the search path. The following queries need this for getting the fully qualified name(schema.name) of every db object
|
||||||
tabs <- HT.statement mempty $ allTables prepared
|
tabs <- HT.statement mempty $ allTables prepared
|
||||||
cols <- HT.statement schemas $ allColumns tabs prepared
|
cols <- HT.statement schemas $ allColumns tabs prepared
|
||||||
@@ -937,12 +934,6 @@ pfkSourceColumns cols =
|
|||||||
join pks_fks using (resorigtbl, resorigcol)
|
join pks_fks using (resorigtbl, resorigcol)
|
||||||
order by view_schema, view_name, view_column_name; |]
|
order by view_schema, view_name, view_column_name; |]
|
||||||
|
|
||||||
getPgVersion :: H.Session PgVersion
|
|
||||||
getPgVersion = H.statement mempty $ H.Statement sql HE.noParams versionRow False
|
|
||||||
where
|
|
||||||
sql = "SELECT current_setting('server_version_num')::integer, current_setting('server_version')"
|
|
||||||
versionRow = HD.singleRow $ PgVersion <$> column HD.int4 <*> column HD.text
|
|
||||||
|
|
||||||
param :: HE.Value a -> HE.Params a
|
param :: HE.Value a -> HE.Params a
|
||||||
param = HE.param . HE.nonNullable
|
param = HE.param . HE.nonNullable
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ import qualified Hasql.Encoders as HE
|
|||||||
import Data.Foldable (foldr1)
|
import Data.Foldable (foldr1)
|
||||||
import Text.InterpolatedString.Perl6 (qc)
|
import Text.InterpolatedString.Perl6 (qc)
|
||||||
|
|
||||||
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion96)
|
||||||
import PostgREST.DbStructure.Identifiers (FieldName,
|
import PostgREST.DbStructure.Identifiers (FieldName,
|
||||||
QualifiedIdentifier (..))
|
QualifiedIdentifier (..))
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion96)
|
|
||||||
import PostgREST.RangeQuery (NonnegRange, allRange,
|
import PostgREST.RangeQuery (NonnegRange, allRange,
|
||||||
rangeLimit, rangeOffset)
|
rangeLimit, rangeOffset)
|
||||||
import PostgREST.Request.Types (Alias, Field, Filter (..),
|
import PostgREST.Request.Types (Alias, Field, Filter (..),
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ import Data.Maybe (fromJust)
|
|||||||
import Data.Text.Read (decimal)
|
import Data.Text.Read (decimal)
|
||||||
import Network.HTTP.Types.Status (Status)
|
import Network.HTTP.Types.Status (Status)
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion)
|
import PostgREST.Config.PgVersion (PgVersion)
|
||||||
import PostgREST.Error (Error (..))
|
import PostgREST.Error (Error (..))
|
||||||
import PostgREST.GucHeader (GucHeader)
|
import PostgREST.GucHeader (GucHeader)
|
||||||
|
|
||||||
import PostgREST.DbStructure.Identifiers (FieldName)
|
import PostgREST.DbStructure.Identifiers (FieldName)
|
||||||
import PostgREST.Query.SqlFragment
|
import PostgREST.Query.SqlFragment
|
||||||
|
|||||||
+10
-11
@@ -17,14 +17,13 @@ import Control.Retry (RetryStatus, capDelay, exponentialBackoff,
|
|||||||
retrying, rsPreviousDelay)
|
retrying, rsPreviousDelay)
|
||||||
import Data.Text.IO (hPutStrLn)
|
import Data.Text.IO (hPutStrLn)
|
||||||
|
|
||||||
import PostgREST.AppState (AppState)
|
import PostgREST.AppState (AppState)
|
||||||
import PostgREST.Config (AppConfig (..), readAppConfig)
|
import PostgREST.Config (AppConfig (..), readAppConfig)
|
||||||
import PostgREST.Config.Database (loadDbSettings)
|
import PostgREST.Config.Database (queryDbSettings, queryPgVersion)
|
||||||
import PostgREST.DbStructure (getDbStructure, getPgVersion)
|
import PostgREST.Config.PgVersion (PgVersion (..), minimumPgVersion)
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion (..),
|
import PostgREST.DbStructure (queryDbStructure)
|
||||||
minimumPgVersion)
|
import PostgREST.Error (PgError (PgError), checkIsFatal,
|
||||||
import PostgREST.Error (PgError (PgError),
|
errorPayload)
|
||||||
checkIsFatal, errorPayload)
|
|
||||||
|
|
||||||
import qualified PostgREST.AppState as AppState
|
import qualified PostgREST.AppState as AppState
|
||||||
|
|
||||||
@@ -117,7 +116,7 @@ connectionStatus pool =
|
|||||||
|
|
||||||
getConnectionStatus :: IO ConnectionStatus
|
getConnectionStatus :: IO ConnectionStatus
|
||||||
getConnectionStatus = do
|
getConnectionStatus = do
|
||||||
pgVersion <- P.use pool getPgVersion
|
pgVersion <- P.use pool queryPgVersion
|
||||||
case pgVersion of
|
case pgVersion of
|
||||||
Left e -> do
|
Left e -> do
|
||||||
let err = PgError False e
|
let err = PgError False e
|
||||||
@@ -152,7 +151,7 @@ loadSchemaCache appState = do
|
|||||||
AppConfig{..} <- AppState.getConfig appState
|
AppConfig{..} <- AppState.getConfig appState
|
||||||
result <-
|
result <-
|
||||||
P.use (AppState.getPool appState) . HT.transaction HT.ReadCommitted HT.Read $
|
P.use (AppState.getPool appState) . HT.transaction HT.ReadCommitted HT.Read $
|
||||||
getDbStructure (toList configDbSchemas) configDbExtraSearchPath configDbPreparedStatements
|
queryDbStructure (toList configDbSchemas) configDbExtraSearchPath configDbPreparedStatements
|
||||||
case result of
|
case result of
|
||||||
Left e -> do
|
Left e -> do
|
||||||
let
|
let
|
||||||
@@ -227,7 +226,7 @@ reReadConfig startingUp appState = do
|
|||||||
AppConfig{..} <- AppState.getConfig appState
|
AppConfig{..} <- AppState.getConfig appState
|
||||||
dbSettings <-
|
dbSettings <-
|
||||||
if configDbConfig then
|
if configDbConfig then
|
||||||
loadDbSettings (AppState.getPool appState)
|
queryDbSettings (AppState.getPool appState)
|
||||||
else
|
else
|
||||||
pure mempty
|
pure mempty
|
||||||
readAppConfig dbSettings configFilePath (Just configDbUri) >>= \case
|
readAppConfig dbSettings configFilePath (Just configDbUri) >>= \case
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Test.Hspec
|
|||||||
import Test.Hspec.Wai
|
import Test.Hspec.Wai
|
||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion112)
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion112)
|
||||||
|
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Test.Hspec
|
|||||||
import Test.Hspec.Wai
|
import Test.Hspec.Wai
|
||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion112)
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion112)
|
||||||
|
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import Test.Hspec.Wai
|
|||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
import Text.Heredoc
|
import Text.Heredoc
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion112,
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion112,
|
||||||
pgVersion130)
|
pgVersion130)
|
||||||
|
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import Test.Hspec
|
|||||||
import Test.Hspec.Wai
|
import Test.Hspec.Wai
|
||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion112,
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion112,
|
||||||
pgVersion121, pgVersion95)
|
pgVersion121, pgVersion95)
|
||||||
|
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import Test.Hspec.Wai.JSON
|
|||||||
import Protolude
|
import Protolude
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion96)
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion96)
|
||||||
|
|
||||||
spec :: PgVersion -> SpecWith ((), Application)
|
spec :: PgVersion -> SpecWith ((), Application)
|
||||||
spec actualPgVersion =
|
spec actualPgVersion =
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import Test.Hspec hiding (pendingWith)
|
|||||||
import Test.Hspec.Wai
|
import Test.Hspec.Wai
|
||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion112,
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion112,
|
||||||
pgVersion121, pgVersion96)
|
pgVersion121, pgVersion96)
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|
||||||
spec :: PgVersion -> SpecWith ((), Application)
|
spec :: PgVersion -> SpecWith ((), Application)
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import Test.Hspec.Wai
|
|||||||
import Test.Hspec.Wai.JSON
|
import Test.Hspec.Wai.JSON
|
||||||
import Text.Heredoc
|
import Text.Heredoc
|
||||||
|
|
||||||
import PostgREST.DbStructure.PgVersion (PgVersion, pgVersion100,
|
import PostgREST.Config.PgVersion (PgVersion, pgVersion100,
|
||||||
pgVersion109, pgVersion110,
|
pgVersion109, pgVersion110,
|
||||||
pgVersion112, pgVersion114,
|
pgVersion112, pgVersion114,
|
||||||
pgVersion96)
|
pgVersion96)
|
||||||
|
|
||||||
import Protolude hiding (get)
|
import Protolude hiding (get)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|||||||
+9
-8
@@ -8,12 +8,13 @@ import Data.List.NonEmpty (toList)
|
|||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
|
|
||||||
import PostgREST.App (postgrest)
|
import PostgREST.App (postgrest)
|
||||||
import PostgREST.Config (AppConfig (..), LogLevel (..))
|
import PostgREST.Config (AppConfig (..), LogLevel (..))
|
||||||
import PostgREST.DbStructure (getDbStructure, getPgVersion)
|
import PostgREST.Config.Database (queryPgVersion)
|
||||||
import PostgREST.DbStructure.PgVersion (pgVersion96)
|
import PostgREST.Config.PgVersion (pgVersion96)
|
||||||
import Protolude hiding (toList, toS)
|
import PostgREST.DbStructure (queryDbStructure)
|
||||||
import Protolude.Conv (toS)
|
import Protolude hiding (toList, toS)
|
||||||
|
import Protolude.Conv (toS)
|
||||||
import SpecHelper
|
import SpecHelper
|
||||||
|
|
||||||
import qualified PostgREST.AppState as AppState
|
import qualified PostgREST.AppState as AppState
|
||||||
@@ -57,7 +58,7 @@ main = do
|
|||||||
|
|
||||||
pool <- P.acquire (3, 10, toS testDbConn)
|
pool <- P.acquire (3, 10, toS testDbConn)
|
||||||
|
|
||||||
actualPgVersion <- either (panic.show) id <$> P.use pool getPgVersion
|
actualPgVersion <- either (panic.show) id <$> P.use pool queryPgVersion
|
||||||
|
|
||||||
baseDbStructure <-
|
baseDbStructure <-
|
||||||
loadDbStructure pool
|
loadDbStructure pool
|
||||||
@@ -204,4 +205,4 @@ main = do
|
|||||||
|
|
||||||
where
|
where
|
||||||
loadDbStructure pool schemas extraSearchPath =
|
loadDbStructure pool schemas extraSearchPath =
|
||||||
either (panic.show) id <$> P.use pool (HT.transaction HT.ReadCommitted HT.Read $ getDbStructure (toList schemas) extraSearchPath True)
|
either (panic.show) id <$> P.use pool (HT.transaction HT.ReadCommitted HT.Read $ queryDbStructure (toList schemas) extraSearchPath True)
|
||||||
|
|||||||
Reference in New Issue
Block a user