这是indexloc提供的服务,不要输入任何密码
Skip to content
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: 2 additions & 4 deletions server/graphql-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ flag profile

library
hs-source-dirs: src-lib
, src-exec
default-language: Haskell2010
build-depends: base
, pg-client
Expand Down Expand Up @@ -108,8 +107,8 @@ library

-- Templating
, mustache
, ginger
, file-embed
, shakespeare >= 2.0.22

--
, data-has
Expand Down Expand Up @@ -289,8 +288,6 @@ library
, Hasura.SQL.Types
, Hasura.SQL.Value
, Network.URI.Extended
, Ops
, Migrate

other-modules: Hasura.Server.Auth.JWT.Internal
, Hasura.Server.Auth.JWT.Logging
Expand Down Expand Up @@ -395,6 +392,7 @@ executable graphql-engine

other-modules: Ops
, Migrate
, Migrate.Version

if flag(developer)
ghc-prof-options: -rtsopts -fprof-auto -fno-prof-count-entries
Expand Down
15 changes: 8 additions & 7 deletions server/src-exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ import Hasura.Logging
import Hasura.Prelude
import Hasura.RQL.DDL.Metadata (fetchMetadata)
import Hasura.RQL.Types (SQLGenCtx (..), SchemaCache (..),
adminUserInfo, emptySchemaCache)
SystemDefined (..), adminUserInfo,
emptySchemaCache)
import Hasura.Server.App (HasuraApp (..),
SchemaCacheRef (..), getSCFromRef,
logInconsObjs, mkWaiApp)
import Hasura.Server.Auth
import Hasura.Server.CheckUpdates (checkForUpdates)
import Hasura.Server.Init
import Hasura.Server.Logging
import Hasura.Server.Query (peelRun)
import Hasura.Server.Query (RunCtx (..), peelRun)
import Hasura.Server.SchemaUpdate
import Hasura.Server.Telemetry
import Hasura.Server.Version (currentVersion)
Expand Down Expand Up @@ -234,8 +235,9 @@ main = do
runExceptT $ Q.runTx pool (Q.Serializable, Nothing) tx

runAsAdmin pool sqlGenCtx httpManager m = do
res <- runExceptT $ peelRun emptySchemaCache adminUserInfo
httpManager sqlGenCtx (PGExecCtx pool Q.Serializable) m
res <- runExceptT $ peelRun emptySchemaCache
(RunCtx adminUserInfo httpManager sqlGenCtx $ SystemDefined True)
(PGExecCtx pool Q.Serializable) m
return $ fmap fst res

procConnInfo rci =
Expand All @@ -254,9 +256,8 @@ main = do
either printErrJExit (logger . mkGenericStrLog LevelInfo "db_init") initRes

-- migrate catalog if necessary
migRes <- runAsAdmin pool sqlGenCtx httpMgr $
migrateCatalog currentTime
either printErrJExit (logger . mkGenericStrLog LevelInfo "db_migrate") migRes
migRes <- runAsAdmin pool sqlGenCtx httpMgr $ migrateCatalog currentTime
either printErrJExit logger migRes

-- retrieve database id
eDbId <- runTx pool getDbId
Expand Down
Loading