napkin-0.5.13
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.PGCommon

Description

 
Synopsis

Documentation

data Named a #

Constructors

Named 

Fields

Instances

Instances details
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 #

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 #

FromField (Named Value) # 
Instance details

Defined in Napkin.Run.PGCommon

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

class HasPostgresConn a where #

Instances

Instances details
HasPostgresConn Redshift # 
Instance details

Defined in Napkin.Run.Redshift

HasPostgresConn Postgres # 
Instance details

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 #

checkTableExists #

Arguments

:: (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.

data PGSchemaField #

Constructors

PGSchemaField 

Instances

Instances details
Eq PGSchemaField # 
Instance details

Defined in Napkin.Run.PGCommon

Show PGSchemaField # 
Instance details

Defined in Napkin.Run.PGCommon

FromRow PGSchemaField # 
Instance details

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

Orphan instances

FromRow (Map Text Value) # 
Instance details