diff options
Diffstat (limited to '')
-rw-r--r-- | lib/Persist.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Persist.hs b/lib/Persist.hs index 46e5ef4..e268455 100644 --- a/lib/Persist.hs +++ b/lib/Persist.hs @@ -142,6 +142,8 @@ TrainPing json sql=tt_trip_ping token TrackerId geopos Geopos timestamp UTCTime + sequence Double + ticket TicketId deriving Show Generic Eq -- status of a train somewhen in time (may be in the future), @@ -177,6 +179,8 @@ instance ToSchema TrainAnchor where instance ToSchema Announcement where declareNamedSchema = genericDeclareNamedSchema (GTFS.swaggerOptions "announcement") +type InSql a = ReaderT SqlBackend (LoggingT (ResourceT IO)) a + runSqlWithoutLog :: MonadIO m => Pool SqlBackend -> ReaderT SqlBackend (NoLoggingT (ResourceT IO)) a @@ -188,7 +192,7 @@ runSqlWithoutLog pool = liftIO . flip runSqlPersistMPool pool -- no better way than to nest logger monads … runSql :: (MonadLogger m, MonadIO m, MonadReader LoggingConfig m) => Pool SqlBackend - -> ReaderT SqlBackend (LoggingT (ResourceT IO)) a + -> InSql a -> m a runSql pool x = do conf <- ask |