napkin-0.5.14
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageGHC2021

Napkin.Run.PGCommon

Description

 
Synopsis

Documentation

data Named a #

Constructors

Named 

Fields

Instances

Instances details
Show a => Show (Named a) # 
Instance details

Defined in Napkin.Run.PGCommon

Methods

showsPrec :: Int -> Named a -> ShowS #

show :: Named a -> String #

showList :: [Named a] -> ShowS #

Eq a => Eq (Named a) # 
Instance details

Defined in Napkin.Run.PGCommon

Methods

(==) :: Named a -> Named a -> Bool #

(/=) :: Named a -> Named a -> Bool #

Ord a => Ord (Named a) # 
Instance details

Defined in Napkin.Run.PGCommon

Methods

compare :: Named a -> Named a -> Ordering #

(<) :: Named a -> Named a -> Bool #

(<=) :: Named a -> Named a -> Bool #

(>) :: Named a -> Named a -> Bool #

(>=) :: Named a -> Named a -> Bool #

max :: Named a -> Named a -> Named a #

min :: Named a -> Named a -> Named a #

FromField (Named Value) # 
Instance details

Defined in Napkin.Run.PGCommon

namedMap :: [Named a] -> Map Text a #

class HasPostgresConn a where #

Instances

Instances details
HasPostgresConn Postgres # 
Instance details

Defined in Napkin.Run.Postgres

HasPostgresConn Redshift # 
Instance details

Defined in Napkin.Run.Redshift

query :: (Katip m, RenderSql q b, HasPostgresConn b) => b -> BackendConn b -> q -> m [Map Text Value] #

query' :: forall r b q m. (Katip m, RenderSql q b, HasPostgresConn b, FromRow r) => b -> BackendConn b -> q -> m [r] #

execute :: (Katip m, RenderSql q b, HasPostgresConn b) => b -> BackendConn b -> q -> m Int64 #

perform :: (Katip m, RenderSql q b, HasPostgresConn b) => (Connection -> Query -> IO r) -> Text -> b -> BackendConn b -> q -> m r #

checkTableExists #

Arguments

:: (MonadNapkin bk m, HasPostgresConn bk) 
=> bk 
-> BackendConn bk 
-> Ref Table

table

-> m Bool 

Check if tableviewrelation exists. Schema is inferred if Ref contains multiple segments.

data PGSchemaField #

Constructors

PGSchemaField 

Instances

Instances details
Show PGSchemaField # 
Instance details

Defined in Napkin.Run.PGCommon

Eq PGSchemaField # 
Instance details

Defined in Napkin.Run.PGCommon

FromRow PGSchemaField # 
Instance details

Defined in Napkin.Run.PGCommon

relationSchema :: forall bk f viewMeta. (HasPostgresConn bk, viewMeta ~ BackendViewMeta bk, Command DropView () bk, RenderSql DropView bk, Command (CreateView viewMeta) () bk, MonadNapkin bk f, Default viewMeta) => bk -> BackendConn bk -> Relation -> Ref Table -> f [PGSchemaField] #

Introspect schema of a Relation

Orphan instances

FromField Name # 
Instance details

FromRow AnnotationRow # 
Instance details

FromRow TableKind # 
Instance details

FromRow Name # 
Instance details

FromRow (Map Text Value) # 
Instance details