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)
- class Drop a b | a -> b where
- dropCommand :: a -> b
- dropCascade :: a -> Lens' b Bool
- 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
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 #
class Drop a b | a -> b where #
dropCommand :: a -> b #
dropCascade :: a -> Lens' b Bool #
Instances
Drop (CreateViewAs meta) DropView # | |
Defined in Napkin.Types.Commands dropCommand :: CreateViewAs meta -> DropView # dropCascade :: CreateViewAs meta -> Lens' DropView Bool # | |
Drop (CreateTableAs meta) DropTable # | |
Defined in Napkin.Types.Commands dropCommand :: CreateTableAs meta -> DropTable # dropCascade :: CreateTableAs meta -> Lens' DropTable Bool # |
module Napkin.Types.Commands.Grant