Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype GetRelationSchema = GetRelationSchema {}
- newtype CheckTableExists = CheckTableExists {}
- data DeleteFrom = DeleteFrom {}
- data InsertIntoQuery = InsertIntoQuery {}
- data DropTable = DropTable {
- _dtName :: Ref Table
- _dtIfExists :: Bool
- _dtCascade :: Bool
- data DropView = DropView {
- _dvName :: Ref Table
- _dvMaterialized :: ViewType
- _dvIfExists :: Bool
- _dvCascade :: Bool
- data CreateMaterializedViewAs meta = CreateMaterializedViewAs {}
- data CreateViewAs meta = CreateViewAs {}
- data ViewType
- data CopyTable = CopyTable {}
- data RenameTable = RenameTable {}
- data CreateTableAs meta = CreateTableAs {}
- type family BackendMaterializedViewMeta bk
- type family BackendViewMeta bk
- type family BackendTableMeta bk
- createTable :: Default d => Ref Table -> Query -> CreateTableAs d
- dropView :: Ref Table -> DropView
- dropTable :: Ref Table -> DropTable
- createToInsert :: CreateTableAs m -> InsertIntoQuery
- ctaMeta :: forall meta meta. Lens (CreateTableAs meta) (CreateTableAs meta) meta meta
- ctaName :: forall meta. Lens' (CreateTableAs meta) (Ref Table)
- ctaQuery :: forall meta. Lens' (CreateTableAs meta) Query
- cvaMeta :: forall meta meta. Lens (CreateViewAs meta) (CreateViewAs meta) meta meta
- cvaName :: forall meta. Lens' (CreateViewAs meta) (Ref Table)
- cvaQuery :: forall meta. Lens' (CreateViewAs meta) Query
- cmvaMeta :: forall meta meta. Lens (CreateMaterializedViewAs meta) (CreateMaterializedViewAs meta) meta meta
- cmvaName :: forall meta. Lens' (CreateMaterializedViewAs meta) (Ref Table)
- cmvaQuery :: forall meta. Lens' (CreateMaterializedViewAs meta) Query
- rtFrom :: Lens' RenameTable (Ref Table)
- rtTo :: Lens' RenameTable (Ref Table)
- ctFrom :: Lens' CopyTable (Ref Table)
- ctTo :: Lens' CopyTable (Ref Table)
- dtCascade :: Lens' DropTable Bool
- dtIfExists :: Lens' DropTable Bool
- dtName :: Lens' DropTable (Ref Table)
- dvCascade :: Lens' DropView Bool
- dvIfExists :: Lens' DropView Bool
- dvMaterialized :: Lens' DropView ViewType
- dvName :: Lens' DropView (Ref Table)
- iiqQuery :: Lens' InsertIntoQuery Query
- iiqTable :: Lens' InsertIntoQuery (Ref Table)
- dfTable :: Lens' DeleteFrom (Ref Table)
- dfWhere :: Lens' DeleteFrom SExp
- cteTable :: Iso' CheckTableExists (Ref Table)
- grsRelation :: Iso' GetRelationSchema Relation
- module Napkin.Types.Commands.Grant
Documentation
newtype GetRelationSchema #
Instances
newtype CheckTableExists #
Instances
data DeleteFrom #
TODO: Add in the USING clause
Instances
data InsertIntoQuery #
Instances
Drop a table
DropTable | |
|
Instances
Drop a table
DropView | |
|
Instances
data CreateMaterializedViewAs meta #
Instances
data CreateViewAs meta #
Instances
Instances
Eq ViewType # | |
Data ViewType # | |
Defined in Napkin.Types.Commands gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ViewType -> c ViewType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ViewType # toConstr :: ViewType -> Constr # dataTypeOf :: ViewType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ViewType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ViewType) # gmapT :: (forall b. Data b => b -> b) -> ViewType -> ViewType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ViewType -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ViewType -> r # gmapQ :: (forall d. Data d => d -> u) -> ViewType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ViewType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ViewType -> m ViewType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewType -> m ViewType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewType -> m ViewType # | |
Show ViewType # | |
Instances
Eq CopyTable # | |
Data CopyTable # | |
Defined in Napkin.Types.Commands gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CopyTable -> c CopyTable # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CopyTable # toConstr :: CopyTable -> Constr # dataTypeOf :: CopyTable -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CopyTable) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CopyTable) # gmapT :: (forall b. Data b => b -> b) -> CopyTable -> CopyTable # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CopyTable -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CopyTable -> r # gmapQ :: (forall d. Data d => d -> u) -> CopyTable -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CopyTable -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CopyTable -> m CopyTable # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CopyTable -> m CopyTable # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CopyTable -> m CopyTable # | |
Show CopyTable # | |
Command CopyTable () Sqlite # | |
Defined in Napkin.Run.Sqlite execCommand :: (Katip m, MonadQueryStats m) => BackendConn Sqlite -> CopyTable -> m () # | |
Command CopyTable () Redshift # | |
Defined in Napkin.Run.Redshift execCommand :: (Katip m, MonadQueryStats m) => BackendConn Redshift -> CopyTable -> m () # | |
Command CopyTable () Postgres # | |
Defined in Napkin.Run.Postgres execCommand :: (Katip m, MonadQueryStats m) => BackendConn Postgres -> CopyTable -> m () # | |
Command CopyTable () BigQuery # | |
Defined in Napkin.Run.BigQuery execCommand :: (Katip m, MonadQueryStats m) => BackendConn BigQuery -> CopyTable -> m () # |
data RenameTable #
Instances
data CreateTableAs meta #
Create table based on a query with variable metadata type, such
as TableMeta
Instances
type family BackendMaterializedViewMeta bk #
Instances
type BackendMaterializedViewMeta Sqlite # | |
Defined in Napkin.Types.Sqlite | |
type BackendMaterializedViewMeta Redshift # | |
Defined in Napkin.Types.Redshift | |
type BackendMaterializedViewMeta Postgres # | |
Defined in Napkin.Types.Postgres | |
type BackendMaterializedViewMeta BigQuery # | |
Defined in Napkin.Types.BigQuery |
type family BackendViewMeta bk #
Instances
type BackendViewMeta Sqlite # | |
Defined in Napkin.Types.Sqlite | |
type BackendViewMeta Redshift # | |
Defined in Napkin.Types.Redshift | |
type BackendViewMeta Postgres # | |
Defined in Napkin.Types.Postgres | |
type BackendViewMeta BigQuery # | |
Defined in Napkin.Types.BigQuery |
type family BackendTableMeta bk #
Operations like recreate
often result in ambiguous types at
application site. In general, we need to be able to infer a
type for the table metadata type for each backend. Our life is
complicated by the likes of Redshift TableMeta
Instances
type BackendTableMeta Sqlite # | |
Defined in Napkin.Types.Sqlite | |
type BackendTableMeta Redshift # | |
Defined in Napkin.Types.Redshift | |
type BackendTableMeta Postgres # | |
Defined in Napkin.Types.Postgres | |
type BackendTableMeta BigQuery # | |
Defined in Napkin.Types.BigQuery |
createTable :: Default d => Ref Table -> Query -> CreateTableAs d #
createToInsert :: CreateTableAs m -> InsertIntoQuery #
ctaMeta :: forall meta meta. Lens (CreateTableAs meta) (CreateTableAs meta) meta meta #
ctaQuery :: forall meta. Lens' (CreateTableAs meta) Query #
cvaMeta :: forall meta meta. Lens (CreateViewAs meta) (CreateViewAs meta) meta meta #
cvaQuery :: forall meta. Lens' (CreateViewAs meta) Query #
cmvaMeta :: forall meta meta. Lens (CreateMaterializedViewAs meta) (CreateMaterializedViewAs meta) meta meta #
cmvaQuery :: forall meta. Lens' (CreateMaterializedViewAs meta) Query #
dvIfExists :: Lens' DropView Bool #
dfWhere :: Lens' DeleteFrom SExp #
module Napkin.Types.Commands.Grant