feat: request.spec GUC for db-root-spec
The request.spec GUC contains the schema cache structure in json. It's only available when the root endpoint(/) is requested and when db-root-spec is not empty. Also correct db-root-spec to accept a schema.
This commit is contained in:
committed by
Steve Chavez
parent
f169661ce6
commit
d99909c403
@@ -7,6 +7,7 @@ module PostgREST.Workers
|
||||
, listener
|
||||
) where
|
||||
|
||||
import qualified Data.Aeson as JSON
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Hasql.Connection as C
|
||||
import qualified Hasql.Notifications as N
|
||||
@@ -172,6 +173,8 @@ loadSchemaCache appState = do
|
||||
|
||||
Right dbStructure -> do
|
||||
AppState.putDbStructure appState dbStructure
|
||||
when (isJust configDbRootSpec) $
|
||||
AppState.putJsonDbS appState $ toS $ JSON.encode dbStructure
|
||||
putStrLn ("Schema cache loaded" :: Text)
|
||||
return SCLoaded
|
||||
|
||||
|
||||
Reference in New Issue
Block a user