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
- checkTableExists :: (Katip f, HasPostgresConn bk, RenderSql Query bk) => bk -> BackendConn bk -> Ref Table -> f Bool
- qry_checkTable :: String -> String -> Q ()
- relationSchema :: (Katip f, HasPostgresConn bk, Command DropView t0 bk, RenderSql DropView bk, Command CreateViewAs t1 bk, CommandDescr DropView bk, MonadQueryStats f) => bk -> BackendConn bk -> Relation -> f (Fields Field)
- refFqTable :: Ref a -> FQTable
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 #
:: (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 :: (Katip f, HasPostgresConn bk, Command DropView t0 bk, RenderSql DropView bk, Command CreateViewAs t1 bk, CommandDescr DropView bk, MonadQueryStats f) => bk -> BackendConn bk -> Relation -> f (Fields Field) #
Introspect schema of a Relation
refFqTable :: Ref a -> FQTable #