@@ -10,6 +10,7 @@ module ProjectM36.Client
11 executeRelationalExpr,
11 executeRelationalExpr,
12 executeDatabaseContextExpr,
12 executeDatabaseContextExpr,
13+ executeDatabaseContextIOExpr,
13 executeGraphExpr,
14 executeGraphExpr,
@@ -64,6 +65,7 @@ import ProjectM36.Persist (DiskSync(..))
64import ProjectM36.Notifications
65import ProjectM36.Notifications
65import ProjectM36.Server.RemoteCallTypes
66import ProjectM36.Server.RemoteCallTypes
66import ProjectM36.Relation (typesAsRelation)
67import ProjectM36.Relation (typesAsRelation)
68+import ProjectM36.AtomFunctionBody (initScriptSession, ScriptSession)
67import qualified ProjectM36.Relation as R
69import qualified ProjectM36.Relation as R
68import Network.Transport.TCP (createTransport, defaultTCPParameters, encodeEndPointAddress)
70import Network.Transport.TCP (createTransport, defaultTCPParameters, encodeEndPointAddress)
69import Control.Distributed.Process.Node (newLocalNode, initRemoteTable, runProcess, LocalNode, forkProcess)
71import Control.Distributed.Process.Node (newLocalNode, initRemoteTable, runProcess, LocalNode, forkProcess)
@@ -137,7 +139,7 @@ defaultRemoteConnectionInfo = RemoteProcessConnectionInfo defaultDatabaseName (c
137-- | The 'Connection' represents either local or remote access to a database. All operations flow through the connection.
139-- | The 'Connection' represents either local or remote access to a database. All operations flow through the connection.
138type ClientNodes = STMSet.Set ProcessId
140type ClientNodes = STMSet.Set ProcessId
140−data Connection = InProcessConnection PersistenceStrategy ClientNodes Sessions (TVar TransactionGraph) |
142+data Connection = InProcessConnection PersistenceStrategy ClientNodes Sessions (TVar TransactionGraph) ScriptSession |
141 RemoteProcessConnection LocalNode ProcessId
143 RemoteProcessConnection LocalNode ProcessId
143-- | There are several reasons why a connection can fail.
145-- | There are several reasons why a connection can fail.
@@ -193,7 +195,8 @@ connectProjectM36 (InProcessConnectionInfo strat notificationCallback) = do
193 clientNodes <- STMSet.newIO
195 clientNodes <- STMSet.newIO
194 sessions <- STMMap.newIO
196 sessions <- STMMap.newIO
195 notificationPid <- startNotificationListener notificationCallback
197 notificationPid <- startNotificationListener notificationCallback
198+ interpreterSession <- initScriptSession
196− let conn = InProcessConnection strat clientNodes sessions graphTvar
199+ let conn = InProcessConnection strat clientNodes sessions graphTvar interpreterSession
197 addClientNode conn notificationPid
200 addClientNode conn notificationPid
198 pure (Right conn)
201 pure (Right conn)
199 MinimalPersistence dbdir -> connectPersistentProjectM36 strat NoDiskSync dbdir freshGraph notificationCallback
202 MinimalPersistence dbdir -> connectPersistentProjectM36 strat NoDiskSync dbdir freshGraph notificationCallback
@@ -239,21 +242,22 @@ connectPersistentProjectM36 strat sync dbdir freshGraph notificationCallback = d
239 tvarGraph <- newTVarIO graph'
242 tvarGraph <- newTVarIO graph'
240 sessions <- STMMap.newIO
243 sessions <- STMMap.newIO
241 clientNodes <- STMSet.newIO
244 clientNodes <- STMSet.newIO
245+ scriptSession <- initScriptSession
242− let conn = InProcessConnection strat clientNodes sessions tvarGraph
246+ let conn = InProcessConnection strat clientNodes sessions tvarGraph scriptSession
243 notificationPid <- startNotificationListener notificationCallback
247 notificationPid <- startNotificationListener notificationCallback
244 addClientNode conn notificationPid
248 addClientNode conn notificationPid
245 pure (Right conn)
249 pure (Right conn)
247-- | Create a new session at the transaction id and return the session's Id.
251-- | Create a new session at the transaction id and return the session's Id.
248createSessionAtCommit :: TransactionId -> Connection -> IO (Either RelationalError SessionId)
252createSessionAtCommit :: TransactionId -> Connection -> IO (Either RelationalError SessionId)
249−createSessionAtCommit commitId conn@(InProcessConnection _ _ _ _) = do
253+createSessionAtCommit commitId conn@(InProcessConnection _ _ _ _ _) = do
250 newSessionId <- nextRandom
254 newSessionId <- nextRandom
251 atomically $ do
255 atomically $ do
252 createSessionAtCommit_ commitId newSessionId conn
256 createSessionAtCommit_ commitId newSessionId conn
253createSessionAtCommit uuid conn@(RemoteProcessConnection _ _) = remoteCall conn (CreateSessionAtCommit uuid)
257createSessionAtCommit uuid conn@(RemoteProcessConnection _ _) = remoteCall conn (CreateSessionAtCommit uuid)
255createSessionAtCommit_ :: TransactionId -> SessionId -> Connection -> STM (Either RelationalError SessionId)
259createSessionAtCommit_ :: TransactionId -> SessionId -> Connection -> STM (Either RelationalError SessionId)
256−createSessionAtCommit_ commitId newSessionId (InProcessConnection _ _ sessions graphTvar) = do
260+createSessionAtCommit_ commitId newSessionId (InProcessConnection _ _ sessions graphTvar _) = do
257 graph <- readTVar graphTvar
261 graph <- readTVar graphTvar
258 case transactionForId commitId graph of
262 case transactionForId commitId graph of
259 Left err -> pure (Left err)
263 Left err -> pure (Left err)
@@ -269,7 +273,7 @@ createSessionAtCommit_ _ _ (RemoteProcessConnection _ _) = error "createSessionA
270-- | Call 'createSessionAtHead' with a transaction graph's head's name to create a new session pinned to that head. This function returns a 'SessionId' which can be used in other function calls to reference the point in the transaction graph.
274-- | Call 'createSessionAtHead' with a transaction graph's head's name to create a new session pinned to that head. This function returns a 'SessionId' which can be used in other function calls to reference the point in the transaction graph.
271createSessionAtHead :: HeadName -> Connection -> IO (Either RelationalError SessionId)
275createSessionAtHead :: HeadName -> Connection -> IO (Either RelationalError SessionId)
272−createSessionAtHead headn conn@(InProcessConnection _ _ _ graphTvar) = do
276+createSessionAtHead headn conn@(InProcessConnection _ _ _ graphTvar _) = do
273 newSessionId <- nextRandom
277 newSessionId <- nextRandom
274 atomically $ do
278 atomically $ do
275 graph <- readTVar graphTvar
279 graph <- readTVar graphTvar
@@ -281,16 +285,16 @@ createSessionAtHead headn conn@(RemoteProcessConnection _ _) = remoteCall conn (
281-- | Used internally for server connections to keep track of remote nodes for the purpose of sending notifications later.
285-- | Used internally for server connections to keep track of remote nodes for the purpose of sending notifications later.
282addClientNode :: Connection -> ProcessId -> IO ()
286addClientNode :: Connection -> ProcessId -> IO ()
283addClientNode (RemoteProcessConnection _ _) _ = error "addClientNode called on remote connection"
287addClientNode (RemoteProcessConnection _ _) _ = error "addClientNode called on remote connection"
284−addClientNode (InProcessConnection _ clientNodes _ _) newProcessId = atomically (STMSet.insert newProcessId clientNodes)
288+addClientNode (InProcessConnection _ clientNodes _ _ _) newProcessId = atomically (STMSet.insert newProcessId clientNodes)
286-- | Discards a session, eliminating any uncommitted changes present in the session.
290-- | Discards a session, eliminating any uncommitted changes present in the session.
287closeSession :: SessionId -> Connection -> IO ()
291closeSession :: SessionId -> Connection -> IO ()
288−closeSession sessionId (InProcessConnection _ _ sessions _) = do
292+closeSession sessionId (InProcessConnection _ _ sessions _ _) = do
289 atomically $ STMMap.delete sessionId sessions
293 atomically $ STMMap.delete sessionId sessions
290closeSession sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (CloseSession sessionId)
294closeSession sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (CloseSession sessionId)
291-- | 'close' cleans up the database access connection. Note that sessions persist even after the connection is closed.
295-- | 'close' cleans up the database access connection. Note that sessions persist even after the connection is closed.
292close :: Connection -> IO ()
296close :: Connection -> IO ()
293−close (InProcessConnection _ _ sessions _) = atomically $ do
297+close (InProcessConnection _ _ sessions _ _) = atomically $ do
294 traverse_ (\(k,_) -> STMMap.delete k sessions) (STMMap.stream sessions)
298 traverse_ (\(k,_) -> STMMap.delete k sessions) (STMMap.stream sessions)
@@ -307,7 +311,7 @@ runProcessResult localNode proc = do
307 takeMVar ret
311 takeMVar ret
309remoteCall :: (Serializable a, Serializable b) => Connection -> a -> IO b
313remoteCall :: (Serializable a, Serializable b) => Connection -> a -> IO b
310−remoteCall (InProcessConnection _ _ _ _) _ = error "remoteCall called on local connection"
314+remoteCall (InProcessConnection _ _ _ _ _) _ = error "remoteCall called on local connection"
311remoteCall (RemoteProcessConnection localNode serverProcessId) arg = runProcessResult localNode $ do
315remoteCall (RemoteProcessConnection localNode serverProcessId) arg = runProcessResult localNode $ do
312 ret <- safeCall serverProcessId arg
316 ret <- safeCall serverProcessId arg
313 case ret of
317 case ret of
@@ -321,7 +325,7 @@ sessionForSessionId sessionId sessions = do
322-- | Execute a relational expression in the context of the session and connection. Relational expressions are queries and therefore cannot alter the database.
326-- | Execute a relational expression in the context of the session and connection. Relational expressions are queries and therefore cannot alter the database.
323executeRelationalExpr :: SessionId -> Connection -> RelationalExpr -> IO (Either RelationalError Relation)
327executeRelationalExpr :: SessionId -> Connection -> RelationalExpr -> IO (Either RelationalError Relation)
324−executeRelationalExpr sessionId (InProcessConnection _ _ sessions _) expr = atomically $ do
328+executeRelationalExpr sessionId (InProcessConnection _ _ sessions _ _) expr = atomically $ do
325 eSession <- sessionForSessionId sessionId sessions
329 eSession <- sessionForSessionId sessionId sessions
326 case eSession of
330 case eSession of
327 Left err -> pure $ Left err
331 Left err -> pure $ Left err
@@ -330,7 +334,7 @@ executeRelationalExpr sessionId conn@(RemoteProcessConnection _ _) relExpr = rem
331-- | Execute a database context expression in the context of the session and connection. Database expressions modify the current session's disconnected transaction but cannot modify the transaction graph.
335-- | Execute a database context expression in the context of the session and connection. Database expressions modify the current session's disconnected transaction but cannot modify the transaction graph.
332executeDatabaseContextExpr :: SessionId -> Connection -> DatabaseContextExpr -> IO (Maybe RelationalError)
336executeDatabaseContextExpr :: SessionId -> Connection -> DatabaseContextExpr -> IO (Maybe RelationalError)
333−executeDatabaseContextExpr sessionId (InProcessConnection _ _ sessions _) expr = atomically $ do
337+executeDatabaseContextExpr sessionId (InProcessConnection _ _ sessions _ _) expr = atomically $ do
334 eSession <- sessionForSessionId sessionId sessions
338 eSession <- sessionForSessionId sessionId sessions
335 case eSession of
339 case eSession of
336 Left err -> pure $ Just err
340 Left err -> pure $ Just err
@@ -342,6 +346,24 @@ executeDatabaseContextExpr sessionId (InProcessConnection _ _ sessions _) expr =
342 STMMap.insert newSession sessionId sessions
346 STMMap.insert newSession sessionId sessions
343 return Nothing
347 return Nothing
344executeDatabaseContextExpr sessionId conn@(RemoteProcessConnection _ _) dbExpr = remoteCall conn (ExecuteDatabaseContextExpr sessionId dbExpr)
348executeDatabaseContextExpr sessionId conn@(RemoteProcessConnection _ _) dbExpr = remoteCall conn (ExecuteDatabaseContextExpr sessionId dbExpr)
350+-- | Execute a database context IO-monad-based expression for the given session and connection. `DatabaseContextIOExpr` modify the DatabaseContext but cannot be purely implemented.
351+--this is almost completely identical to executeDatabaseContextExpr above
352+executeDatabaseContextIOExpr :: SessionId -> Connection -> DatabaseContextIOExpr -> IO (Maybe RelationalError)
353+executeDatabaseContextIOExpr sessionId (InProcessConnection _ _ sessions _ scriptSession) expr = do
354+ eSession <- atomically $ sessionForSessionId sessionId sessions --potentially race condition due to interleaved IO?
356+ Left err -> pure $ Just err
358+ res <- RE.evalDatabaseContextIOExpr scriptSession (sessionContext session) expr
360+ Left err -> pure (Just err)
361+ Right context' -> do
362+ let newDiscon = DisconnectedTransaction (sessionParentId session) context'
363+ newSession = Session newDiscon
364+ atomically $ STMMap.insert newSession sessionId sessions
366+executeDatabaseContextIOExpr sessionId conn@(RemoteProcessConnection _ _) dbExpr = remoteCall conn (ExecuteDatabaseContextIOExpr sessionId dbExpr)
346executeGraphExprSTM_ :: TransactionId -> SessionId -> Sessions -> TransactionGraphOperator -> TVar TransactionGraph -> STM (Either RelationalError TransactionGraph)
368executeGraphExprSTM_ :: TransactionId -> SessionId -> Sessions -> TransactionGraphOperator -> TVar TransactionGraph -> STM (Either RelationalError TransactionGraph)
347executeGraphExprSTM_ freshId sessionId sessions graphExpr graphTvar = do
369executeGraphExprSTM_ freshId sessionId sessions graphExpr graphTvar = do
@@ -369,7 +391,7 @@ executeCommitExprSTM_ oldContext newContext nodes = do
370-- | Execute a transaction graph expression in the context of the session and connection. Transaction graph operators modify the transaction graph state.
392-- | Execute a transaction graph expression in the context of the session and connection. Transaction graph operators modify the transaction graph state.
371executeGraphExpr :: SessionId -> Connection -> TransactionGraphOperator -> IO (Maybe RelationalError)
393executeGraphExpr :: SessionId -> Connection -> TransactionGraphOperator -> IO (Maybe RelationalError)
372−executeGraphExpr sessionId (InProcessConnection strat clientNodes sessions graphTvar) graphExpr = do
394+executeGraphExpr sessionId (InProcessConnection strat clientNodes sessions graphTvar _) graphExpr = do
373 freshId <- nextRandom
395 freshId <- nextRandom
374 manip <- atomically $ do
396 manip <- atomically $ do
375 eSession <- sessionForSessionId sessionId sessions
397 eSession <- sessionForSessionId sessionId sessions
@@ -411,7 +433,7 @@ commitSTM_ freshUUID sessionId sessions graph = do
412-- | After modifying a session, 'commit' the transaction to the transaction graph at the head which the session is referencing. This will also trigger checks for any notifications which need to be propagated.
434-- | After modifying a session, 'commit' the transaction to the transaction graph at the head which the session is referencing. This will also trigger checks for any notifications which need to be propagated.
413commit :: SessionId -> Connection -> IO (Maybe RelationalError)
435commit :: SessionId -> Connection -> IO (Maybe RelationalError)
414−commit sessionId conn@(InProcessConnection _ _ _ _) = executeGraphExpr sessionId conn Commit
436+commit sessionId conn@(InProcessConnection _ _ _ _ _) = executeGraphExpr sessionId conn Commit
415commit sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteGraphExpr sessionId Commit)
437commit sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteGraphExpr sessionId Commit)
417sendNotifications :: [ProcessId] -> EvaluatedNotifications -> IO ()
439sendNotifications :: [ProcessId] -> EvaluatedNotifications -> IO ()
@@ -425,7 +447,7 @@ sendNotifications pids nots = mapM_ sendNots pids
426-- | Discard any changes made in the current session. This resets the disconnected transaction to reference the original database context of the parent transaction and is a very cheap operation.
448-- | Discard any changes made in the current session. This resets the disconnected transaction to reference the original database context of the parent transaction and is a very cheap operation.
427rollback :: SessionId -> Connection -> IO (Maybe RelationalError)
449rollback :: SessionId -> Connection -> IO (Maybe RelationalError)
428−rollback sessionId conn@(InProcessConnection _ _ _ _) = executeGraphExpr sessionId conn Rollback
450+rollback sessionId conn@(InProcessConnection _ _ _ _ _) = executeGraphExpr sessionId conn Rollback
429rollback sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteGraphExpr sessionId Rollback)
451rollback sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteGraphExpr sessionId Rollback)
431processPersistence :: PersistenceStrategy -> TransactionGraph -> IO ()
453processPersistence :: PersistenceStrategy -> TransactionGraph -> IO ()
@@ -435,11 +457,11 @@ processPersistence (CrashSafePersistence dbdir) graph = transactionGraphPersist
436-- | Return a relation whose type would match that of the relational expression if it were executed. This is useful for checking types and validating a relational expression's types.
458-- | Return a relation whose type would match that of the relational expression if it were executed. This is useful for checking types and validating a relational expression's types.
437typeForRelationalExpr :: SessionId -> Connection -> RelationalExpr -> IO (Either RelationalError Relation)
459typeForRelationalExpr :: SessionId -> Connection -> RelationalExpr -> IO (Either RelationalError Relation)
438−typeForRelationalExpr sessionId conn@(InProcessConnection _ _ _ _) relExpr = atomically $ typeForRelationalExprSTM sessionId conn relExpr
460+typeForRelationalExpr sessionId conn@(InProcessConnection _ _ _ _ _) relExpr = atomically $ typeForRelationalExprSTM sessionId conn relExpr
439typeForRelationalExpr sessionId conn@(RemoteProcessConnection _ _) relExpr = remoteCall conn (ExecuteTypeForRelationalExpr sessionId relExpr)
461typeForRelationalExpr sessionId conn@(RemoteProcessConnection _ _) relExpr = remoteCall conn (ExecuteTypeForRelationalExpr sessionId relExpr)
441typeForRelationalExprSTM :: SessionId -> Connection -> RelationalExpr -> STM (Either RelationalError Relation)
463typeForRelationalExprSTM :: SessionId -> Connection -> RelationalExpr -> STM (Either RelationalError Relation)
442−typeForRelationalExprSTM sessionId (InProcessConnection _ _ sessions _) relExpr = do
464+typeForRelationalExprSTM sessionId (InProcessConnection _ _ sessions _ _) relExpr = do
443 eSession <- sessionForSessionId sessionId sessions
465 eSession <- sessionForSessionId sessionId sessions
444 case eSession of
466 case eSession of
445 Left err -> pure $ Left err
467 Left err -> pure $ Left err
@@ -449,7 +471,7 @@ typeForRelationalExprSTM _ _ _ = error "typeForRelationalExprSTM called on non-l
450-- | Return a 'Map' of the database's constraints at the context of the session and connection.
472-- | Return a 'Map' of the database's constraints at the context of the session and connection.
451inclusionDependencies :: SessionId -> Connection -> IO (Either RelationalError (M.Map IncDepName InclusionDependency))
473inclusionDependencies :: SessionId -> Connection -> IO (Either RelationalError (M.Map IncDepName InclusionDependency))
452−inclusionDependencies sessionId (InProcessConnection _ _ sessions _) = do
474+inclusionDependencies sessionId (InProcessConnection _ _ sessions _ _) = do
453 atomically $ do
475 atomically $ do
454 eSession <- sessionForSessionId sessionId sessions
476 eSession <- sessionForSessionId sessionId sessions
455 case eSession of
477 case eSession of
@@ -460,7 +482,7 @@ inclusionDependencies sessionId conn@(RemoteProcessConnection _ _) = remoteCall
461-- | Return an optimized database expression which is logically equivalent to the input database expression. This function can be used to determine which expression will actually be evaluated.
483-- | Return an optimized database expression which is logically equivalent to the input database expression. This function can be used to determine which expression will actually be evaluated.
462planForDatabaseContextExpr :: SessionId -> Connection -> DatabaseContextExpr -> IO (Either RelationalError DatabaseContextExpr)
484planForDatabaseContextExpr :: SessionId -> Connection -> DatabaseContextExpr -> IO (Either RelationalError DatabaseContextExpr)
463−planForDatabaseContextExpr sessionId (InProcessConnection _ _ sessions _) dbExpr = do
485+planForDatabaseContextExpr sessionId (InProcessConnection _ _ sessions _ _) dbExpr = do
464 atomically $ do
486 atomically $ do
465 eSession <- sessionForSessionId sessionId sessions
487 eSession <- sessionForSessionId sessionId sessions
466 case eSession of
488 case eSession of
@@ -474,7 +496,7 @@ planForDatabaseContextExpr sessionId conn@(RemoteProcessConnection _ _) dbExpr =
474-- * id- id attribute of the transaction
496-- * id- id attribute of the transaction
475-- * parents- a relation-valued attribute which contains a relation of transaction ids which are parent transaction to the transaction
497-- * parents- a relation-valued attribute which contains a relation of transaction ids which are parent transaction to the transaction
476transactionGraphAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
498transactionGraphAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
477−transactionGraphAsRelation sessionId (InProcessConnection _ _ sessions tvar) = do
499+transactionGraphAsRelation sessionId (InProcessConnection _ _ sessions tvar _) = do
478 atomically $ do
500 atomically $ do
479 eSession <- sessionForSessionId sessionId sessions
501 eSession <- sessionForSessionId sessionId sessions
480 case eSession of
502 case eSession of
@@ -486,7 +508,7 @@ transactionGraphAsRelation sessionId (InProcessConnection _ _ sessions tvar) = d
486transactionGraphAsRelation sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (RetrieveTransactionGraph sessionId)
508transactionGraphAsRelation sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (RetrieveTransactionGraph sessionId)
488relationVariablesAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
510relationVariablesAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
489−relationVariablesAsRelation sessionId (InProcessConnection _ _ sessions _) = do
511+relationVariablesAsRelation sessionId (InProcessConnection _ _ sessions _ _) = do
490 atomically $ do
512 atomically $ do
491 eSession <- sessionForSessionId sessionId sessions
513 eSession <- sessionForSessionId sessionId sessions
492 case eSession of
514 case eSession of
@@ -497,7 +519,7 @@ relationVariablesAsRelation sessionId conn@(RemoteProcessConnection _ _) = remot
498-- | Returns the transaction id for the connection's disconnected transaction committed parent transaction.
520-- | Returns the transaction id for the connection's disconnected transaction committed parent transaction.
499headTransactionId :: SessionId -> Connection -> IO (Maybe TransactionId)
521headTransactionId :: SessionId -> Connection -> IO (Maybe TransactionId)
500−headTransactionId sessionId (InProcessConnection _ _ sessions _) = do
522+headTransactionId sessionId (InProcessConnection _ _ sessions _ _) = do
501 atomically $ do
523 atomically $ do
502 eSession <- sessionForSessionId sessionId sessions
524 eSession <- sessionForSessionId sessionId sessions
503 case eSession of
525 case eSession of
@@ -517,12 +539,12 @@ headNameSTM_ sessionId sessions graphTvar = do
518-- | Returns Just the name of the head of the current disconnected transaction or Nothing.
540-- | Returns Just the name of the head of the current disconnected transaction or Nothing.
519headName :: SessionId -> Connection -> IO (Maybe HeadName)
541headName :: SessionId -> Connection -> IO (Maybe HeadName)
520−headName sessionId (InProcessConnection _ _ sessions graphTvar) = do
542+headName sessionId (InProcessConnection _ _ sessions graphTvar _) = do
521 atomically (headNameSTM_ sessionId sessions graphTvar)
543 atomically (headNameSTM_ sessionId sessions graphTvar)
522headName sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteHeadName sessionId)
544headName sessionId conn@(RemoteProcessConnection _ _) = remoteCall conn (ExecuteHeadName sessionId)
524atomTypesAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
546atomTypesAsRelation :: SessionId -> Connection -> IO (Either RelationalError Relation)
525−atomTypesAsRelation sessionId (InProcessConnection _ _ sessions _) = do
547+atomTypesAsRelation sessionId (InProcessConnection _ _ sessions _ _) = do
526 atomically $ do
548 atomically $ do
527 eSession <- sessionForSessionId sessionId sessions
549 eSession <- sessionForSessionId sessionId sessions
528 case eSession of
550 case eSession of