Safe Haskell | None |
---|---|
Language | GHC2024 |
Synopsis
- newtype PrettySqlError = PrettySqlError SqlError
- data Named a = Named {
- _namedName :: Text
- _namedItem :: a
- namedMap :: [Named a] -> Map Text a
- class HasPostgresConn a where
- getPostgresConn :: BackendConn a -> Pool Connection
- listTables :: (MonadNapkin b m, HasPostgresConn b) => Set Prefix -> BackendConn b -> m (Set ListedTable)
- query :: (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => BackendConn b -> q -> m [Map Text Value]
- query' :: forall r b q m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b, FromRow r) => BackendConn b -> q -> m [r]
- execute :: forall b q m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => BackendConn b -> q -> m ()
- obtainTableKind :: (MonadNapkin b m, HasPostgresConn b) => BackendConn b -> Ref Table -> m TableKind
- annotate :: (MonadNapkin b m, HasPostgresConn b, RenderSql AnnotateTableOrView b) => BackendConn b -> Ref Table -> Annotation -> m ()
- readAnnotations :: (MonadNapkin b m, HasPostgresConn b) => BackendConn b -> Ref Table -> m TableAnnotations
- perform :: forall b q r m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => (Connection -> Query -> IO r) -> Text -> BackendConn b -> q -> m r
- getDefaultSchema :: (MonadNapkin bk m, HasPostgresConn bk) => BackendConn bk -> m Name
- checkTableExists :: (MonadNapkin bk m, HasPostgresConn bk) => BackendConn bk -> Ref Table -> m Bool
- normalizedTableMap :: (MonadNapkin bk m, HasPostgresConn bk) => Set (Ref Table) -> BackendConn bk -> m (Map (Ref Table) NormalizedTable)
- data PGSchemaField = PGSchemaField {}
- relationSchema :: (HasPostgresConn bk, RenderSql DropRelation bk, MonadNapkin bk f, Default (BackendMeta 'KindView bk), FromRow (BackendSchemaField bk), Backend bk, RenderSql (CreateRelation bk) bk) => BackendConn bk -> Ref Table -> Relation -> f [BackendSchemaField bk]
- refFqTable :: forall {k} (a :: k). Ref a -> (Text, Text)
- getPostgresSchema :: (MonadNapkin b m, HasPostgresConn b, FromRow (BackendSchemaField b)) => BackendConn b -> (Text, Text) -> m [BackendSchemaField b]
- renameTableAndMoveSchema :: (MonadNapkin bk m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameRelation bk) => BackendConn bk -> RenameRelation -> m ()
- tellRowsAffected :: forall {k} (bk :: k) m. MonadNapkin bk m => Proxy bk -> Int64 -> m ()
- fieldTypeByName :: Text -> Type
Documentation
newtype PrettySqlError #
Instances
Exception PrettySqlError # | |
Defined in Napkin.Run.PGCommon | |
Show PrettySqlError # | |
Defined in Napkin.Run.PGCommon showsPrec :: Int -> PrettySqlError -> ShowS # show :: PrettySqlError -> String # showList :: [PrettySqlError] -> ShowS # |
Named | |
|
class HasPostgresConn a where #
getPostgresConn :: BackendConn a -> Pool Connection #
Instances
HasPostgresConn Postgres # | |
Defined in Napkin.Run.Postgres | |
HasPostgresConn Redshift # | |
Defined in Napkin.Run.Redshift |
listTables :: (MonadNapkin b m, HasPostgresConn b) => Set Prefix -> BackendConn b -> m (Set ListedTable) #
query :: (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => BackendConn b -> q -> m [Map Text Value] #
query' :: forall r b q m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b, FromRow r) => BackendConn b -> q -> m [r] #
execute :: forall b q m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => BackendConn b -> q -> m () #
obtainTableKind :: (MonadNapkin b m, HasPostgresConn b) => BackendConn b -> Ref Table -> m TableKind #
annotate :: (MonadNapkin b m, HasPostgresConn b, RenderSql AnnotateTableOrView b) => BackendConn b -> Ref Table -> Annotation -> m () #
readAnnotations :: (MonadNapkin b m, HasPostgresConn b) => BackendConn b -> Ref Table -> m TableAnnotations #
perform :: forall b q r m. (MonadNapkin b m, RenderSql q b, HasPostgresConn b) => (Connection -> Query -> IO r) -> Text -> BackendConn b -> q -> m r #
getDefaultSchema :: (MonadNapkin bk m, HasPostgresConn bk) => BackendConn bk -> m Name #
checkTableExists :: (MonadNapkin bk m, HasPostgresConn bk) => BackendConn bk -> Ref Table -> m Bool #
Check if tableviewrelation exists. Schema is inferred if Ref contains multiple segments.
normalizedTableMap :: (MonadNapkin bk m, HasPostgresConn bk) => Set (Ref Table) -> BackendConn bk -> m (Map (Ref Table) NormalizedTable) #
data PGSchemaField #
Instances
Show PGSchemaField # | |
Defined in Napkin.Run.PGCommon showsPrec :: Int -> PGSchemaField -> ShowS # show :: PGSchemaField -> String # showList :: [PGSchemaField] -> ShowS # | |
Eq PGSchemaField # | |
Defined in Napkin.Run.PGCommon (==) :: PGSchemaField -> PGSchemaField -> Bool # (/=) :: PGSchemaField -> PGSchemaField -> Bool # | |
FromRow PGSchemaField # | |
Defined in Napkin.Run.PGCommon |
relationSchema :: (HasPostgresConn bk, RenderSql DropRelation bk, MonadNapkin bk f, Default (BackendMeta 'KindView bk), FromRow (BackendSchemaField bk), Backend bk, RenderSql (CreateRelation bk) bk) => BackendConn bk -> Ref Table -> Relation -> f [BackendSchemaField bk] #
Introspect schema of a Relation
refFqTable :: forall {k} (a :: k). Ref a -> (Text, Text) #
getPostgresSchema :: (MonadNapkin b m, HasPostgresConn b, FromRow (BackendSchemaField b)) => BackendConn b -> (Text, Text) -> m [BackendSchemaField b] #
renameTableAndMoveSchema :: (MonadNapkin bk m, RenderSql SetTableSchema bk, HasPostgresConn bk, RenderSql RenameRelation bk) => BackendConn bk -> RenameRelation -> m () #
tellRowsAffected :: forall {k} (bk :: k) m. MonadNapkin bk m => Proxy bk -> Int64 -> m () #
fieldTypeByName :: Text -> Type #