Safe Haskell | None |
---|---|
Language | GHC2024 |
Documentation
type ConnectionString = Text #
type MonadNapkin (b :: k) (m :: Type -> Type) = (Monad m, BackendDialect b, Katip m, MonadUnliftIO m, LocalQueryStats b m, RenderSql Query b) #
backendConnectionString, backendExecute, backendQuery, backendCheckTableExists, backendGetTableKind, backendGetRelationSchema, backendGetAnnotations, backendAnnotate, backendDrop, backendRename, backendListTables, backendNormalize
data BackendConn b #
backendConnectionString :: BackendConn b -> ConnectionString #
backendExecute :: (MonadNapkin b m, RenderSql command b) => BackendConn b -> command -> m () #
backendQuery :: (MonadNapkin b m, RenderSql q b) => BackendConn b -> q -> m [Map Text Value] #
backendCheckTableExists :: MonadNapkin b m => BackendConn b -> Ref Table -> m Bool #
backendGetTableKind :: MonadNapkin b m => BackendConn b -> Ref Table -> m TableKind #
backendGetRelationSchema :: MonadNapkin b m => BackendConn b -> Ref Table -> Relation -> m [BackendSchemaField b] #
backendGetAnnotations :: MonadNapkin b m => BackendConn b -> Ref Table -> m TableAnnotations #
backendAnnotate :: MonadNapkin b m => BackendConn b -> Ref Table -> Annotation -> m () #
backendCreateAs :: (command ~ CreateRelation b, RenderSql command b, MonadNapkin b m) => BackendConn b -> command -> m () #
backendCreate :: (command ~ CreateTableSchema b, RenderSql command b, MonadNapkin b m) => BackendConn b -> command -> m () #
backendCopyTable :: (MonadNapkin b m, RenderSql DeleteRows b, RenderSql InsertInto b, RenderSql (CreateRelation b) b, Default (BackendMeta 'KindTable b)) => BackendConn b -> Ref Table -> Ref Table -> TableWriteStrategy -> m () #
backendDrop :: MonadNapkin b m => BackendConn b -> DropRelation -> m () #
backendInsertInto :: (command ~ InsertInto, RenderSql command b, MonadNapkin b m) => BackendConn b -> command -> m () #
backendRename :: MonadNapkin b m => BackendConn b -> RenameRelation -> m () #
backendListTables :: MonadNapkin b m => BackendConn b -> ListTables -> m (Set ListedTable) #
backendNormalize :: MonadNapkin b m => BackendConn b -> NormalizeTableNames -> m (Map (Ref Table) NormalizedTable) #
class HasBackendQueryStats b => LocalQueryStats (b :: k) (m :: Type -> Type) where #
tellStats :: QueryStats b -> m () #
Instances
HasBackendQueryStats b => LocalQueryStats (b :: k) IO # | |
Defined in Napkin.Run.Base tellStats :: QueryStats b -> IO () # | |
HasBackendQueryStats b => LocalQueryStats (b :: k) (KatipT IO) # | |
Defined in Napkin.Run.Base tellStats :: QueryStats b -> KatipT IO () # | |
HasBackendQueryStats backend => LocalQueryStats (backend :: k) (ReaderT (IORef (QueryStats backend)) (KatipT IO)) # | |
Defined in Napkin.Run.Base tellStats :: QueryStats backend -> ReaderT (IORef (QueryStats backend)) (KatipT IO) () # |
discardQueryStats :: Katip m => KatipT IO a -> m a #