Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Named a = Named {
- _namedName :: Text
- _namedItem :: a
- namedMap :: [Named a] -> Map Text a
- class HasPostgresConn a where
- getPostgresConn :: BackendConn a -> Pool Connection
- query :: (Katip m, RenderSql q b, HasPostgresConn b) => b -> BackendConn b -> q -> m [Map Text Value]
- execute :: (Katip m, RenderSql a1 b, HasPostgresConn a2) => b -> BackendConn a2 -> a1 -> m Int64
- getDefaultSchema :: (Katip f, HasPostgresConn bk, RenderSql Query bk) => bk -> BackendConn bk -> f Name
- checkTableExists :: (Katip f, HasPostgresConn bk, RenderSql Query bk) => bk -> BackendConn bk -> Ref Table -> f Bool
- qry_checkTable :: String -> String -> Q ()
- relationSchema :: forall bk f viewMeta t1. (Katip f, HasPostgresConn bk, viewMeta ~ BackendViewMeta bk, Command DropView t1 bk, RenderSql DropView bk, Command (CreateViewAs viewMeta) t1 bk, MonadQueryStats f, Default viewMeta) => bk -> BackendConn bk -> Relation -> f (Fields Field)
- refFqTable :: Ref a -> FQTable
- renameTableAndMoveSchema :: (Monad m, Katip m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameTable bk, RenderSql Query bk) => bk -> BackendConn bk -> RenameTable -> m Int64
Documentation
Named | |
|
class HasPostgresConn a where #
getPostgresConn :: BackendConn a -> Pool Connection #
Instances
HasPostgresConn Redshift # | |
Defined in Napkin.Run.Redshift | |
HasPostgresConn Postgres # | |
Defined in Napkin.Run.Postgres |
query :: (Katip m, RenderSql q b, HasPostgresConn b) => b -> BackendConn b -> q -> m [Map Text Value] #
execute :: (Katip m, RenderSql a1 b, HasPostgresConn a2) => b -> BackendConn a2 -> a1 -> m Int64 #
getDefaultSchema :: (Katip f, HasPostgresConn bk, RenderSql Query bk) => bk -> BackendConn bk -> f Name #
:: (Katip f, HasPostgresConn bk, RenderSql Query bk) | |
=> bk | |
-> BackendConn bk | |
-> Ref Table | table |
-> f Bool |
Check if tableviewrelation exists. Schema is inferred if Ref contains multiple segments.
qry_checkTable :: String -> String -> Q () #
Check if tableviewrelation exists in given schema.
http://stackoverflow.com/questions/20582500/how-to-check-if-a-table-exists-in-a-given-schema
relationSchema :: forall bk f viewMeta t1. (Katip f, HasPostgresConn bk, viewMeta ~ BackendViewMeta bk, Command DropView t1 bk, RenderSql DropView bk, Command (CreateViewAs viewMeta) t1 bk, MonadQueryStats f, Default viewMeta) => bk -> BackendConn bk -> Relation -> f (Fields Field) #
Introspect schema of a Relation
refFqTable :: Ref a -> FQTable #
renameTableAndMoveSchema :: (Monad m, Katip m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameTable bk, RenderSql Query bk) => bk -> BackendConn bk -> RenameTable -> m Int64 #