napkin-spec-2.0.0
Safe HaskellNone
LanguageGHC2024

Napkin.Run.Base

Documentation

class Backend b where #

Associated Types

data BackendConn b #

Methods

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 #

Methods

tellStats :: QueryStats b -> m () #

Instances

Instances details
HasBackendQueryStats b => LocalQueryStats (b :: k) IO # 
Instance details

Defined in Napkin.Run.Base

Methods

tellStats :: QueryStats b -> IO () #

HasBackendQueryStats b => LocalQueryStats (b :: k) (KatipT IO) # 
Instance details

Defined in Napkin.Run.Base

Methods

tellStats :: QueryStats b -> KatipT IO () #

HasBackendQueryStats backend => LocalQueryStats (backend :: k) (ReaderT (IORef (QueryStats backend)) (KatipT IO)) # 
Instance details

Defined in Napkin.Run.Base

Methods

tellStats :: QueryStats backend -> ReaderT (IORef (QueryStats backend)) (KatipT IO) () #

discardQueryStats :: Katip m => KatipT IO a -> m a #