Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type SqlReadIO m bk = (SqlIO m, MonadNapkin bk m, Backend bk, Command CheckTableExists Bool bk, Command GetTableKind TableKind bk, Command GetRelationSchema [BackendSchemaField bk] bk)
- runSqlReadIO :: forall m bk a r. (SqlReadIO m bk, Members [FatalError, Embed m] r) => BackendConn bk -> Sem (SqlRead bk ': r) a -> Sem r a
Documentation
type SqlReadIO m bk = (SqlIO m, MonadNapkin bk m, Backend bk, Command CheckTableExists Bool bk, Command GetTableKind TableKind bk, Command GetRelationSchema [BackendSchemaField bk] bk) #
A multi-backend interpreter that uses our previous Command
typeclass machinery to dispatch to different backends. This is an
easy way to write a single interpreter that works for all backends,
given that we already have the typeclass based machinery in place.
Alternatively, we could get rid of the command system and implement either individual interpreters for each backend, or pass in backend-specific capability dictionaries/records or something.
runSqlReadIO :: forall m bk a r. (SqlReadIO m bk, Members [FatalError, Embed m] r) => BackendConn bk -> Sem (SqlRead bk ': r) a -> Sem r a #