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 ()
- data PGSchemaField = PGSchemaField {}
- relationSchema :: forall bk f viewMeta. (Katip f, HasPostgresConn bk, viewMeta ~ BackendViewMeta bk, Command DropView () bk, RenderSql DropView bk, Command (CreateViewAs viewMeta) () bk, MonadQueryStats f, Default viewMeta) => bk -> BackendConn bk -> Relation -> f [PGSchemaField]
- refFqTable :: Ref a -> (String, String)
- getPostgresSchema :: MonadIO m => Pool Connection -> (String, String) -> m [PGSchemaField]
- renameTableAndMoveSchema :: (Monad m, Katip m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameTable bk, RenderSql Query bk) => bk -> BackendConn bk -> RenameTable -> m ()
- tellRowsAffected :: (Monad m, MonadQueryStats m) => Maybe (Ref Table) -> Int64 -> m ()
- fieldTypeByName :: Text -> Type
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
data PGSchemaField #
Instances
Eq PGSchemaField # | |
Defined in Napkin.Run.PGCommon (==) :: PGSchemaField -> PGSchemaField -> Bool # (/=) :: PGSchemaField -> PGSchemaField -> Bool # | |
Show PGSchemaField # | |
Defined in Napkin.Run.PGCommon showsPrec :: Int -> PGSchemaField -> ShowS # show :: PGSchemaField -> String # showList :: [PGSchemaField] -> ShowS # | |
FromRow PGSchemaField # | |
Defined in Napkin.Run.PGCommon |
relationSchema :: forall bk f viewMeta. (Katip f, HasPostgresConn bk, viewMeta ~ BackendViewMeta bk, Command DropView () bk, RenderSql DropView bk, Command (CreateViewAs viewMeta) () bk, MonadQueryStats f, Default viewMeta) => bk -> BackendConn bk -> Relation -> f [PGSchemaField] #
Introspect schema of a Relation
refFqTable :: Ref a -> (String, String) #
getPostgresSchema :: MonadIO m => Pool Connection -> (String, String) -> m [PGSchemaField] #
renameTableAndMoveSchema :: (Monad m, Katip m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameTable bk, RenderSql Query bk) => bk -> BackendConn bk -> RenameTable -> m () #
tellRowsAffected :: (Monad m, MonadQueryStats m) => Maybe (Ref Table) -> Int64 -> m () #
fieldTypeByName :: Text -> Type #