Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data Name
- textName :: Text -> Name
- nameString :: Name -> String
- nameText :: Name -> Text
- nameLitStr :: Name -> SrcLitStr
- nameStringQuoted :: Name -> Text
- _name :: Iso' String Name
- newtype Ref a = Ref {}
- text2Ref :: Text -> Ref a
- newtype NormalizedTable = Normalized {}
- data ListedTableKind
- data ListedTable = ListedTable {}
- newtype TemporaryTableName = TemporaryTableName (Ref Table)
- newtype SpecTableName = SpecTableName {}
- useSpecName :: SpecTableName -> Ref Table
- class IsRef a where
- refComponentCount :: Ref a -> Int
- stringRefIso :: Iso' String (Ref a)
- refStringIso :: Iso' (Ref a) String
- stringRef :: String -> Ref a
- textRef :: Text -> Ref a
- nameRef :: Name -> Ref a
- namesRef :: [Name] -> Ref a
- sNamesRef :: NonEmpty Name -> Ref a
- sNameRef :: Name -> Ref a
- refString :: Ref t -> String
- specTableString :: SpecTableName -> String
- refText :: Ref t -> Text
- specTableText :: SpecTableName -> Text
- retagRef :: Ref t -> Ref a
- appendRef :: Ref a -> Name -> Ref a
- star :: SExp
- data Table
- data Function
- keywordRef :: String -> Ref Function
- data Selected a = Selected {
- _selectRef :: Ref a
- _selectItem :: a
- data Alias a = Alias {
- _aliasRef :: Maybe (Ref a)
- _aliasItem :: a
- nonAlias :: a -> Alias a
- class WithName a where
- sa :: WithName a => Ref b -> b -> a b
- selectToAlias :: Selected a -> Alias a
- data StructField
- data Value
- newtype Interval = Interval {
- _unInterval :: [(SExp, DatePart)]
- data IntInterval = IntInterval SExp DatePart
- data ArrayBase
- data Nullability
- data Field = Field Nullability Type
- data SExp
- = Lit Value
- | Var (Ref SExp)
- | ArraySelect Query
- | ArrayItem { }
- | Array { }
- | Struct { }
- | FieldAccess { }
- | Extern ExternFun
- | Case [(SExp, SExp)] SExp
- | ExceptColumns SExp [Ref SExp]
- | SubQuery Query
- | NativeExpr NativeExpr
- data NativeExpr
- var :: Ref a -> SExp
- varString :: String -> SExp
- nil :: SExp
- data NullStrategy
- data Distinctness
- type Partition = [SExp]
- data WOver = WOver {}
- data WindowFrameUnit
- data WindowFun = SimpleWindow (Ref Function) [SExp] WOver (Maybe NullStrategy)
- data WindowFrame
- data FrameLength
- data FunModifier
- data ExternFun
- = SimpleExtern (Ref Function) [SExp]
- | ParensExtern [ParensOperator]
- | ModExtern (Ref Function) [SExp] [FunModifier]
- | Cast SExp Type
- | SafeCast SExp Type
- | ExternWindow WindowFun
- | ExternRaw String
- type OriginTypeName = Text
- data Type
- data DatePart
- type Order = [OrderPart]
- type GroupBy = [SExp]
- data OrderDir
- invertOrder :: OrderDir -> OrderDir
- data NullOrder
- data OrderPart = OrderPart {}
- order :: SExp -> OrderPart
- data Relation
- table :: Ref a -> Relation
- data JoinType
- data From = From (Selected Relation) [(Selected Relation, JoinType, Either (Maybe SExp) [Ref SExp])]
- fromAliases :: From -> [Ref Relation]
- data UnionType
- data RawQuery = RawQuery {
- _rawQuery_deps :: [Ref Table]
- _rawQuery_raw :: String
- data CteBody
- = JustCteBody (Selected Query)
- | PositionalBoundsCteBody (NonEmpty (Ref SExp)) (Selected Query)
- data WithClauses = WithClauses {}
- orderWithInserted :: WithClauses -> [(Ref Query, CteBody)]
- cteRefs :: WithClauses -> Set (Ref a)
- data AsStruct
- type Keyword = Ref Function
- data ParensOperatorArgument
- data ParensOperator
- mapSExpOfParensOperatorArg :: (SExp -> SExp) -> ParensOperatorArgument -> ParensOperatorArgument
- type ColumnComment = (Ref SExp, Text)
- data Query
- = Query {
- _queryWith :: WithClauses
- _querySelect :: [Alias SExp]
- _queryComments :: [ColumnComment]
- _queryFrom :: Maybe From
- _queryTableOperator :: Maybe ParensOperator
- _queryWhere :: Maybe SExp
- _queryHaving :: Maybe SExp
- _queryGroup :: GroupBy
- _queryOrder :: Order
- _queryLimit :: Maybe Int
- _queryOffset :: Maybe Int
- _queryDistinct :: Distinctness
- _queryAs :: AsStruct
- | Union { }
- | QueryRaw RawQuery
- | NativeQuery NativeQuery
- = Query {
- data NativeQuery
- emptyQuery :: Query
- mkUnion :: UnionType -> [Query] -> Query
- collectUnionQueries :: Query -> NonEmpty Query
- data DefinedRelation = forall s.(AsRelation s, HasDefinition s, MaybeQuery s) => DefinedRelation s
- data DefinedQuery = forall s.HasDefinition s => DefinedQuery s
- class AsRelation s where
- asRelation :: s -> Relation
- class HasDefinition s where
- class MaybeQuery s where
- queryFullySpecified :: Data a => a -> Bool
- opOrder :: Lens' OrderPart OrderDir
- opNulls :: Lens' OrderPart (Maybe NullOrder)
- opExp :: Lens' OrderPart SExp
- rawQuery_raw :: Lens' RawQuery String
- rawQuery_deps :: Lens' RawQuery [Ref Table]
- unionWiths :: Traversal' Query WithClauses
- unionType :: Traversal' Query UnionType
- unionQuery2 :: Traversal' Query Query
- unionQuery1 :: Traversal' Query Query
- queryWith :: Traversal' Query WithClauses
- queryWhere :: Traversal' Query (Maybe SExp)
- queryTableOperator :: Traversal' Query (Maybe ParensOperator)
- querySelect :: Traversal' Query [Alias SExp]
- queryOrder :: Traversal' Query Order
- queryOffset :: Traversal' Query (Maybe Int)
- queryLimit :: Traversal' Query (Maybe Int)
- queryHaving :: Traversal' Query (Maybe SExp)
- queryGroup :: Traversal' Query GroupBy
- queryFrom :: Traversal' Query (Maybe From)
- queryDistinct :: Traversal' Query Distinctness
- queryComments :: Traversal' Query [ColumnComment]
- queryAs :: Traversal' Query AsStruct
- _NativeQuery :: Prism' Query NativeQuery
- _QueryRaw :: Prism' Query RawQuery
- _Union :: Prism' Query (UnionType, Query, Query, WithClauses)
- _Query :: Prism' Query (WithClauses, [Alias SExp], [ColumnComment], Maybe From, Maybe ParensOperator, Maybe SExp, Maybe SExp, GroupBy, Order, Maybe Int, Maybe Int, Distinctness, AsStruct)
- _From :: Iso' From (Selected Relation, [(Selected Relation, JoinType, Either (Maybe SExp) [Ref SExp])])
- _Star :: Prism' Name ()
- _Specific :: Prism' Name SrcLitStr
- _JoinOuter :: Prism' JoinType ()
- _JoinCross :: Prism' JoinType ()
- _JoinInner :: Prism' JoinType ()
- _JoinRight :: Prism' JoinType ()
- _JoinLeft :: Prism' JoinType ()
- _RawRelation :: Prism' Relation ([Ref Table], String)
- _ArrayRelation :: Prism' Relation SExp
- _QueryRelation :: Prism' Relation Query
- _TableRelation :: Prism' Relation (Ref Table)
- unRef :: forall k (a :: k) k (a :: k). Iso (Ref (a :: k)) (Ref (a :: k)) (NonEmpty Name) (NonEmpty Name)
- _VDatePart :: Prism' Value DatePart
- _VNull :: Prism' Value ()
- _VInterval :: Prism' Value Interval
- _VBinary :: Prism' Value ByteString
- _VText :: Prism' Value SrcLitStr
- _VDateTime :: Prism' Value UTCTime
- _VDate :: Prism' Value Day
- _VBool :: Prism' Value Bool
- _VInt :: Prism' Value Int64
- _VDouble :: Prism' Value Double
- _Microsecond :: Prism' DatePart ()
- _Millisecond :: Prism' DatePart ()
- _Second :: Prism' DatePart ()
- _Minute :: Prism' DatePart ()
- _Hour :: Prism' DatePart ()
- _Day :: Prism' DatePart ()
- _DayOfYear :: Prism' DatePart ()
- _DayOfWeek :: Prism' DatePart ()
- _Week :: Prism' DatePart ()
- _Month :: Prism' DatePart ()
- _Quarter :: Prism' DatePart ()
- _Year :: Prism' DatePart ()
- _Epoch :: Prism' DatePart ()
- _Decade :: Prism' DatePart ()
- _Century :: Prism' DatePart ()
- _Millennium :: Prism' DatePart ()
- _NativeExpr :: Prism' SExp NativeExpr
- _SubQuery :: Prism' SExp Query
- _ExceptColumns :: Prism' SExp (SExp, [Ref SExp])
- _Case :: Prism' SExp ([(SExp, SExp)], SExp)
- _Extern :: Prism' SExp ExternFun
- _FieldAccess :: Prism' SExp (SExp, StructField)
- _Struct :: Prism' SExp (Maybe (OMap StructField Type), OMap StructField SExp)
- _Array :: Prism' SExp (Maybe Type, [SExp])
- _ArrayItem :: Prism' SExp (ArrayBase, Nullability, SExp, SExp)
- _ArraySelect :: Prism' SExp Query
- _Var :: Prism' SExp (Ref SExp)
- _Lit :: Prism' SExp Value
- selectRef :: forall a. Lens' (Selected a) (Ref a)
- selectItem :: forall a. Lens' (Selected a) a
- aliasRef :: forall a. Lens' (Alias a) (Maybe (Ref a))
- aliasItem :: forall a. Lens' (Alias a) a
- overPartition :: Lens' WOver Partition
- overOrder :: Lens' WOver Order
- overFrame :: Lens' WOver (Maybe WindowFrame)
- normalizedRef :: Iso' NormalizedTable (Ref Table)
- tableKind :: Lens' ListedTable ListedTableKind
- normalized :: Lens' ListedTable NormalizedTable
- unName :: Traversal' Name SrcLitStr
- withClauses_recursive :: Lens' WithClauses Bool
- withClauses_cteBodies :: Lens' WithClauses (OMap (Ref Query) CteBody)
- _WithClauses :: Iso' WithClauses (Bool, OMap (Ref Query) CteBody)
- allQueryComments :: Lens' Query [ColumnComment]
- refNamespace :: Lens' (Ref a) (Maybe Name)
- class Val a where
- convS :: Lens' Text String
- integral :: (Integral a, Integral b) => Iso' a b
- _lit :: Val a => Prism' SExp a
- lit :: Val a => a -> SExp
- interval :: [(Double, DatePart)] -> SExp
- txt :: String -> SExp
- fullWindow :: WOver
- class TableRef a where
- relationRef :: TableRef a => Getter a Relation
- varAs :: Ref a -> Selected SExp
- asSelf :: SExp -> Selected SExp
- funAs :: (SExp -> b) -> Ref b -> Selected b
- selectToRef :: Selected SExp -> SExp
- selectedExps :: Traversal' [Selected a] a
- selectedNames :: Traversal' [Selected a0] String
- refName :: Traversal (Ref a) (Ref a1) String String
- refLitName :: Traversal (Ref a) (Ref a1) SrcLitStr SrcLitStr
- refRoot :: Lens' (Ref a) Name
- refJustRoot :: Ref a -> Ref a
- refParentRoot :: Ref a -> ([String], Maybe String)
- ne :: Iso' [a] (NonEmpty a)
- selectedName :: Traversal' (Selected a) Name
- atAlias :: (Applicative f, Choice p) => Ref t -> Optic' p f (Alias t) (Alias t)
- aliasedNames :: HasDefinition s => Traversal' s (Ref SExp)
- viewAliasedNames :: (MaybeQuery s, Applicative f, Contravariant f) => (Ref SExp -> f (Ref SExp)) -> s -> f s
- scopeRefs :: Data b => Ref t -> b -> b
- scopeExps :: Data b => Ref t -> b -> b
- modifyExterns :: Data b => (ExternFun -> SExp) -> b -> b
- (^^.) :: Ref Relation -> Name -> SExp
- data AggLevel
- data UpdateQuery = UpdateQuery {}
- updateQueryWhere :: Lens' UpdateQuery (Maybe SExp)
- updateQueryTarget :: Lens' UpdateQuery (Alias (Ref Table))
- updateQuerySet :: Lens' UpdateQuery (OMap Name SExp)
- updateQueryFrom :: Lens' UpdateQuery (Maybe From)
- pattern NapkinTablePrefix :: (Eq a, IsString a) => a
- pattern NapkinTableSeparator :: (Eq a, IsString a) => a
- isTemporaryTable :: Ref Table -> Bool
- tmpTableNameFormat :: UTCTime -> Text -> Text
- getUTCTimeTemporaryTable :: Ref Table -> Maybe UTCTime
- getTemporaryTableName :: MonadIO m => m (Ref b)
Documentation
Copyright : (c) Soostone Inc, 2020 License : AllRightsReserved Stability : experimental Portability : POSIX
Instances
nameString :: Name -> String #
nameLitStr :: Name -> SrcLitStr #
nameStringQuoted :: Name -> Text #
A way to refer to entities like fields, tables, schemas, etc. Namespacing is common so we keep a list here.
Instances
newtype NormalizedTable #
Instances
data ListedTableKind #
Instances
data ListedTable #
Instances
newtype TemporaryTableName #
newtype SpecTableName #
The way to refer to tasks in the spec. With renaming these can then refer to tables in a database. Once renamed, they should never be repacked into newtype. Be careful to avoid use of Constructor SpecTableName internally in Napkin. Ideally, baseTableName will only be used when renaming, but this is less of a concern.
Instances
useSpecName :: SpecTableName -> Ref Table #
An alias for baseTableName to use when renaming. As renaming is the proper way to unpack a SpecTableName, use this when unpacking a SpecTableName for renaming (or potential renaming). A little semantic flag to demarcate proper usages.
Class of string-like types that can be interpreted as Ref
s
Instances
IsRef Name # | |
Defined in Napkin.Types.Core | |
IsRef Text # | |
Defined in Napkin.Types.Core | |
IsRef String # | |
Defined in Napkin.Types.Core | |
IsRef (NonEmpty Name) # | |
IsRef [Name] # | |
Defined in Napkin.Types.Core | |
IsRef (Ref a) # | |
Defined in Napkin.Types.Core |
stringRefIso :: Iso' String (Ref a) #
refStringIso :: Iso' (Ref a) String #
specTableString :: SpecTableName -> String #
specTableText :: SpecTableName -> Text #
Instances
Instances
Data Function # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Function -> c Function # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Function # toConstr :: Function -> Constr # dataTypeOf :: Function -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Function) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Function) # gmapT :: (forall b. Data b => b -> b) -> Function -> Function # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Function -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Function -> r # gmapQ :: (forall d. Data d => d -> u) -> Function -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Function -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Function -> m Function # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Function -> m Function # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Function -> m Function # | |
IsString (Ref Function) # | |
Defined in Napkin.Types.Core fromString :: String -> Ref Function # | |
FoldCase (Ref Function) # | |
keywordRef :: String -> Ref Function #
some functions are keywords and they cannot be
enclosed into default quotes for idens.
(e.g. exists
or not exists
- by default IsString Ref wraps all idens in quotes default for Dialect)
Select something and give it a name; e.g. (my_field as foo)
Selected | |
|
Instances
Foldable Selected # | |
Defined in Napkin.Types.Core fold :: Monoid m => Selected m -> m # foldMap :: Monoid m => (a -> m) -> Selected a -> m # foldMap' :: Monoid m => (a -> m) -> Selected a -> m # foldr :: (a -> b -> b) -> b -> Selected a -> b # foldr' :: (a -> b -> b) -> b -> Selected a -> b # foldl :: (b -> a -> b) -> b -> Selected a -> b # foldl' :: (b -> a -> b) -> b -> Selected a -> b # foldr1 :: (a -> a -> a) -> Selected a -> a # foldl1 :: (a -> a -> a) -> Selected a -> a # elem :: Eq a => a -> Selected a -> Bool # maximum :: Ord a => Selected a -> a # minimum :: Ord a => Selected a -> a # | |
WithName Selected # | |
Defined in Napkin.Types.Core | |
Lift a => Lift (Selected a :: Type) # | |
Data a => Data (Selected a) # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Selected a -> c (Selected a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Selected a) # toConstr :: Selected a -> Constr # dataTypeOf :: Selected a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Selected a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Selected a)) # gmapT :: (forall b. Data b => b -> b) -> Selected a -> Selected a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Selected a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Selected a -> r # gmapQ :: (forall d. Data d => d -> u) -> Selected a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Selected a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Selected a -> m (Selected a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Selected a -> m (Selected a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Selected a -> m (Selected a) # | |
Generic (Selected a) # | |
Show a => Show (Selected a) # | |
NFData a => NFData (Selected a) # | |
Defined in Napkin.Types.Core | |
Eq a => Eq (Selected a) # | |
Ord a => Ord (Selected a) # | |
HasDeps a => HasDeps (Selected a) # | |
Defined in Napkin.Types.Deps | |
FunRenamer (Selected Query) # | |
FunRenamer (Selected Relation) # | |
FunctionTransformer (Selected Query) # | |
FunctionTransformer (Selected Relation) # | |
TableRenamer (Selected Query) # | |
TableRenamer (Selected Relation) # | |
TableRenamer (Selected Table) # | |
type Rep (Selected a) # | |
Defined in Napkin.Types.Core type Rep (Selected a) = D1 ('MetaData "Selected" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "Selected" 'PrefixI 'True) (S1 ('MetaSel ('Just "_selectRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Ref a)) :*: S1 ('MetaSel ('Just "_selectItem") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
Like selected, but aliasing is optional
Alias | |
|
Instances
Foldable Alias # | |
Defined in Napkin.Types.Core fold :: Monoid m => Alias m -> m # foldMap :: Monoid m => (a -> m) -> Alias a -> m # foldMap' :: Monoid m => (a -> m) -> Alias a -> m # foldr :: (a -> b -> b) -> b -> Alias a -> b # foldr' :: (a -> b -> b) -> b -> Alias a -> b # foldl :: (b -> a -> b) -> b -> Alias a -> b # foldl' :: (b -> a -> b) -> b -> Alias a -> b # foldr1 :: (a -> a -> a) -> Alias a -> a # foldl1 :: (a -> a -> a) -> Alias a -> a # elem :: Eq a => a -> Alias a -> Bool # maximum :: Ord a => Alias a -> a # minimum :: Ord a => Alias a -> a # | |
WithName Alias # | |
Defined in Napkin.Types.Core | |
Lift a => Lift (Alias a :: Type) # | |
Data a => Data (Alias a) # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alias a -> c (Alias a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alias a) # toConstr :: Alias a -> Constr # dataTypeOf :: Alias a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Alias a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alias a)) # gmapT :: (forall b. Data b => b -> b) -> Alias a -> Alias a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alias a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alias a -> r # gmapQ :: (forall d. Data d => d -> u) -> Alias a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Alias a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alias a -> m (Alias a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alias a -> m (Alias a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alias a -> m (Alias a) # | |
Generic (Alias a) # | |
Show a => Show (Alias a) # | |
NFData a => NFData (Alias a) # | |
Defined in Napkin.Types.Core | |
Eq a => Eq (Alias a) # | |
Ord a => Ord (Alias a) # | |
HasDeps (Alias SExp) # | |
Defined in Napkin.Types.Deps | |
FunRenamer (Alias SExp) # | |
FunctionTransformer (Alias SExp) # | |
TableRenamer (Alias SExp) # | |
TableRenamer (Alias Table) # | |
RenderSql a BigQuery => RenderSql (Alias a) BigQuery # | |
RenderSql a MsSql => RenderSql (Alias a) MsSql # | |
RenderSql a Postgres => RenderSql (Alias a) Postgres # | |
RenderSql a Redshift => RenderSql (Alias a) Redshift # | |
RenderSql a Sqlite => RenderSql (Alias a) Sqlite # | |
RenderSql (Alias SExp) backend => RenderSql [Alias SExp] backend # | |
type Rep (Alias a) # | |
Defined in Napkin.Types.Core type Rep (Alias a) = D1 ('MetaData "Alias" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "Alias" 'PrefixI 'True) (S1 ('MetaSel ('Just "_aliasRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Ref a))) :*: S1 ('MetaSel ('Just "_aliasItem") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
selectToAlias :: Selected a -> Alias a #
data StructField #
Instances
VDouble !Double | |
VInt !Int64 | |
VBool !Bool | |
VDate !Day | |
VDateTime !UTCTime | |
VText !SrcLitStr | |
VBinary !ByteString | |
VInterval !Interval | |
VNull | |
VDatePart !DatePart |
Instances
Intervals could internally make use of expressions
Interval | |
|
Instances
Data Interval # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Interval -> c Interval # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Interval # toConstr :: Interval -> Constr # dataTypeOf :: Interval -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Interval) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Interval) # gmapT :: (forall b. Data b => b -> b) -> Interval -> Interval # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Interval -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Interval -> r # gmapQ :: (forall d. Data d => d -> u) -> Interval -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Interval -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Interval -> m Interval # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Interval -> m Interval # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Interval -> m Interval # | |
Generic Interval # | |
Show Interval # | |
NFData Interval # | |
Defined in Napkin.Types.Core | |
Eq Interval # | |
Ord Interval # | |
Defined in Napkin.Types.Core | |
Lift Interval # | |
type Rep Interval # | |
Defined in Napkin.Types.Core |
data IntInterval #
Instances
BigQuery array index can be 0-based or 1-based
Instances
Data ArrayBase # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArrayBase -> c ArrayBase # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArrayBase # toConstr :: ArrayBase -> Constr # dataTypeOf :: ArrayBase -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArrayBase) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArrayBase) # gmapT :: (forall b. Data b => b -> b) -> ArrayBase -> ArrayBase # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArrayBase -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArrayBase -> r # gmapQ :: (forall d. Data d => d -> u) -> ArrayBase -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArrayBase -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArrayBase -> m ArrayBase # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArrayBase -> m ArrayBase # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArrayBase -> m ArrayBase # | |
Generic ArrayBase # | |
Show ArrayBase # | |
NFData ArrayBase # | |
Defined in Napkin.Types.Core | |
Eq ArrayBase # | |
Ord ArrayBase # | |
Defined in Napkin.Types.Core | |
Lift ArrayBase # | |
type Rep ArrayBase # | |
data Nullability #
Instances
Lit Value | |
Var (Ref SExp) | |
ArraySelect Query | |
ArrayItem | |
Array | |
Struct | |
FieldAccess | |
Extern ExternFun | external function call |
Case [(SExp, SExp)] SExp | case with a final default |
ExceptColumns SExp [Ref SExp] | t.* EXCEPT(a,b,c) |
SubQuery Query | |
NativeExpr NativeExpr |
Instances
data NativeExpr #
Instances
data NullStrategy #
Instances
data Distinctness #
Instances
Instances
Data WOver # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WOver -> c WOver # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WOver # dataTypeOf :: WOver -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WOver) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WOver) # gmapT :: (forall b. Data b => b -> b) -> WOver -> WOver # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WOver -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WOver -> r # gmapQ :: (forall d. Data d => d -> u) -> WOver -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WOver -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WOver -> m WOver # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WOver -> m WOver # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WOver -> m WOver # | |
Generic WOver # | |
Show WOver # | |
Default WOver # | |
Defined in Napkin.Types.Core | |
NFData WOver # | |
Defined in Napkin.Types.Core | |
Eq WOver # | |
Ord WOver # | |
Lift WOver # | |
type Rep WOver # | |
Defined in Napkin.Types.Core type Rep WOver = D1 ('MetaData "WOver" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "WOver" 'PrefixI 'True) (S1 ('MetaSel ('Just "_overPartition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Partition) :*: (S1 ('MetaSel ('Just "_overOrder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Order) :*: S1 ('MetaSel ('Just "_overFrame") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe WindowFrame))))) |
data WindowFrameUnit #
Instances
Instances
data WindowFrame #
Instances
data FrameLength #
Instances
data FunModifier #
Instances
SimpleExtern (Ref Function) [SExp] | |
ParensExtern [ParensOperator] | |
ModExtern (Ref Function) [SExp] [FunModifier] | |
Cast SExp Type | |
SafeCast SExp Type | |
ExternWindow WindowFun | |
ExternRaw String |
Instances
type OriginTypeName = Text #
Instances
Millennium | |
Century | |
Decade | |
Epoch | |
Year | |
Quarter | |
Month | |
Week | |
DayOfWeek | |
DayOfYear | |
Day | |
Hour | |
Minute | |
Second | |
Millisecond | |
Microsecond |
Instances
Data DatePart # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DatePart -> c DatePart # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DatePart # toConstr :: DatePart -> Constr # dataTypeOf :: DatePart -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DatePart) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DatePart) # gmapT :: (forall b. Data b => b -> b) -> DatePart -> DatePart # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DatePart -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DatePart -> r # gmapQ :: (forall d. Data d => d -> u) -> DatePart -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DatePart -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DatePart -> m DatePart # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DatePart -> m DatePart # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DatePart -> m DatePart # | |
Generic DatePart # | |
Show DatePart # | |
NFData DatePart # | |
Defined in Napkin.Types.Core | |
Eq DatePart # | |
Ord DatePart # | |
Defined in Napkin.Types.Core | |
Val DatePart # | |
Lift DatePart # | |
type Rep DatePart # | |
Defined in Napkin.Types.Core type Rep DatePart = D1 ('MetaData "DatePart" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) ((((C1 ('MetaCons "Millennium" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Century" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Decade" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Epoch" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Year" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Quarter" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Month" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Week" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "DayOfWeek" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DayOfYear" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Day" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Hour" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Minute" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Second" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Millisecond" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Microsecond" 'PrefixI 'False) (U1 :: Type -> Type))))) |
Instances
Data OrderDir # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OrderDir -> c OrderDir # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OrderDir # toConstr :: OrderDir -> Constr # dataTypeOf :: OrderDir -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OrderDir) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrderDir) # gmapT :: (forall b. Data b => b -> b) -> OrderDir -> OrderDir # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OrderDir -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OrderDir -> r # gmapQ :: (forall d. Data d => d -> u) -> OrderDir -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OrderDir -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OrderDir -> m OrderDir # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OrderDir -> m OrderDir # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OrderDir -> m OrderDir # | |
Generic OrderDir # | |
Show OrderDir # | |
NFData OrderDir # | |
Defined in Napkin.Types.Core | |
Eq OrderDir # | |
Ord OrderDir # | |
Defined in Napkin.Types.Core | |
CombiBomb OrderDir # | |
Defined in Napkin.Backends.MsSql.ApiGen.Types | |
Lift OrderDir # | |
type Rep OrderDir # | |
invertOrder :: OrderDir -> OrderDir #
Flip order
Instances
Data NullOrder # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NullOrder -> c NullOrder # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NullOrder # toConstr :: NullOrder -> Constr # dataTypeOf :: NullOrder -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NullOrder) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NullOrder) # gmapT :: (forall b. Data b => b -> b) -> NullOrder -> NullOrder # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NullOrder -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NullOrder -> r # gmapQ :: (forall d. Data d => d -> u) -> NullOrder -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NullOrder -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NullOrder -> m NullOrder # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NullOrder -> m NullOrder # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NullOrder -> m NullOrder # | |
Generic NullOrder # | |
Show NullOrder # | |
NFData NullOrder # | |
Defined in Napkin.Types.Core | |
Eq NullOrder # | |
Ord NullOrder # | |
Defined in Napkin.Types.Core | |
Lift NullOrder # | |
type Rep NullOrder # | |
Instances
Data OrderPart # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OrderPart -> c OrderPart # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OrderPart # toConstr :: OrderPart -> Constr # dataTypeOf :: OrderPart -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OrderPart) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrderPart) # gmapT :: (forall b. Data b => b -> b) -> OrderPart -> OrderPart # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OrderPart -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OrderPart -> r # gmapQ :: (forall d. Data d => d -> u) -> OrderPart -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OrderPart -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OrderPart -> m OrderPart # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OrderPart -> m OrderPart # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OrderPart -> m OrderPart # | |
Generic OrderPart # | |
Show OrderPart # | |
NFData OrderPart # | |
Defined in Napkin.Types.Core | |
Eq OrderPart # | |
Ord OrderPart # | |
Defined in Napkin.Types.Core | |
FunRenamer OrderPart # | |
FunctionTransformer OrderPart # | |
TableRenamer OrderPart # | |
Defined in Napkin.Types.QueryTransformer | |
Lift OrderPart # | |
type Rep OrderPart # | |
Defined in Napkin.Types.Core type Rep OrderPart = D1 ('MetaData "OrderPart" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "OrderPart" 'PrefixI 'True) (S1 ('MetaSel ('Just "_opExp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SExp) :*: (S1 ('MetaSel ('Just "_opOrder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OrderDir) :*: S1 ('MetaSel ('Just "_opNulls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NullOrder))))) |
TableRelation (Ref Table) | |
QueryRelation Query | |
ArrayRelation SExp | |
RawRelation [Ref Table] String | Escape hatch: A raw relation with its dependencies. Avoid if possible |
Instances
Instances
Data JoinType # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JoinType -> c JoinType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JoinType # toConstr :: JoinType -> Constr # dataTypeOf :: JoinType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JoinType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JoinType) # gmapT :: (forall b. Data b => b -> b) -> JoinType -> JoinType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JoinType -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JoinType -> r # gmapQ :: (forall d. Data d => d -> u) -> JoinType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> JoinType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # | |
Generic JoinType # | |
Show JoinType # | |
NFData JoinType # | |
Defined in Napkin.Types.Core | |
Eq JoinType # | |
Ord JoinType # | |
Defined in Napkin.Types.Core | |
Lift JoinType # | |
type Rep JoinType # | |
Defined in Napkin.Types.Core type Rep JoinType = D1 ('MetaData "JoinType" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) ((C1 ('MetaCons "JoinLeft" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "JoinRight" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "JoinInner" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "JoinCross" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "JoinOuter" 'PrefixI 'False) (U1 :: Type -> Type)))) |
Instances
Data From # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> From -> c From # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c From # dataTypeOf :: From -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c From) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c From) # gmapT :: (forall b. Data b => b -> b) -> From -> From # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> From -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> From -> r # gmapQ :: (forall d. Data d => d -> u) -> From -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> From -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> From -> m From # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> From -> m From # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> From -> m From # | |
Generic From # | |
Show From # | |
NFData From # | |
Defined in Napkin.Types.Core | |
Eq From # | |
Ord From # | |
HasDeps From # | |
Defined in Napkin.Types.Deps | |
FunRenamer From # | |
FunctionTransformer From # | |
TableRenamer From # | |
Defined in Napkin.Types.QueryTransformer | |
RenderSql From BigQuery # | |
RenderSql From MsSql # | |
RenderSql From Postgres # | |
RenderSql From Redshift # | |
RenderSql From Sqlite # | |
Lift From # | |
type Rep From # | |
Defined in Napkin.Types.Core type Rep From = D1 ('MetaData "From" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "From" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Selected Relation)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Selected Relation, JoinType, Either (Maybe SExp) [Ref SExp])]))) |
fromAliases :: From -> [Ref Relation] #
Instances
Data UnionType # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnionType -> c UnionType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnionType # toConstr :: UnionType -> Constr # dataTypeOf :: UnionType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnionType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnionType) # gmapT :: (forall b. Data b => b -> b) -> UnionType -> UnionType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnionType -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnionType -> r # gmapQ :: (forall d. Data d => d -> u) -> UnionType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnionType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnionType -> m UnionType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnionType -> m UnionType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnionType -> m UnionType # | |
Generic UnionType # | |
Show UnionType # | |
NFData UnionType # | |
Defined in Napkin.Types.Core | |
Eq UnionType # | |
Ord UnionType # | |
Defined in Napkin.Types.Core | |
Lift UnionType # | |
type Rep UnionType # | |
Defined in Napkin.Types.Core type Rep UnionType = D1 ('MetaData "UnionType" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) ((C1 ('MetaCons "SetUnion" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DuplicateUnion" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IntersectUnion" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MinusUnion" 'PrefixI 'False) (U1 :: Type -> Type))) |
RawQuery | |
|
Instances
Data RawQuery # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RawQuery -> c RawQuery # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RawQuery # toConstr :: RawQuery -> Constr # dataTypeOf :: RawQuery -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RawQuery) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RawQuery) # gmapT :: (forall b. Data b => b -> b) -> RawQuery -> RawQuery # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RawQuery -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RawQuery -> r # gmapQ :: (forall d. Data d => d -> u) -> RawQuery -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RawQuery -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RawQuery -> m RawQuery # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RawQuery -> m RawQuery # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RawQuery -> m RawQuery # | |
Generic RawQuery # | |
Show RawQuery # | |
NFData RawQuery # | |
Defined in Napkin.Types.Core | |
Eq RawQuery # | |
Ord RawQuery # | |
Defined in Napkin.Types.Core | |
Lift RawQuery # | |
type Rep RawQuery # | |
Defined in Napkin.Types.Core type Rep RawQuery = D1 ('MetaData "RawQuery" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "RawQuery" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rawQuery_deps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Ref Table]) :*: S1 ('MetaSel ('Just "_rawQuery_raw") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
Instances
Data CteBody # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CteBody -> c CteBody # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CteBody # toConstr :: CteBody -> Constr # dataTypeOf :: CteBody -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CteBody) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CteBody) # gmapT :: (forall b. Data b => b -> b) -> CteBody -> CteBody # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CteBody -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CteBody -> r # gmapQ :: (forall d. Data d => d -> u) -> CteBody -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CteBody -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CteBody -> m CteBody # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CteBody -> m CteBody # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CteBody -> m CteBody # | |
Generic CteBody # | |
Show CteBody # | |
NFData CteBody # | |
Defined in Napkin.Types.Core | |
Eq CteBody # | |
Ord CteBody # | |
HasDeps CteBody # | |
Defined in Napkin.Types.Deps | |
FunRenamer CteBody # | |
FunctionTransformer CteBody # | |
TableRenamer CteBody # | |
Defined in Napkin.Types.QueryTransformer | |
Lift CteBody # | |
type Rep CteBody # | |
Defined in Napkin.Types.Core type Rep CteBody = D1 ('MetaData "CteBody" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "JustCteBody" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Selected Query))) :+: C1 ('MetaCons "PositionalBoundsCteBody" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (Ref SExp))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Selected Query)))) |
data WithClauses #
CTE expression support- the RECURSIVE keyword allows any subsequently mentioned CTEs to be recursive (but are not necessarily recursive).
Instances
orderWithInserted :: WithClauses -> [(Ref Query, CteBody)] #
cteRefs :: WithClauses -> Set (Ref a) #
Instances
Data AsStruct # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AsStruct -> c AsStruct # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AsStruct # toConstr :: AsStruct -> Constr # dataTypeOf :: AsStruct -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AsStruct) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AsStruct) # gmapT :: (forall b. Data b => b -> b) -> AsStruct -> AsStruct # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AsStruct -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AsStruct -> r # gmapQ :: (forall d. Data d => d -> u) -> AsStruct -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AsStruct -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AsStruct -> m AsStruct # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AsStruct -> m AsStruct # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AsStruct -> m AsStruct # | |
Generic AsStruct # | |
Read AsStruct # | |
Show AsStruct # | |
NFData AsStruct # | |
Defined in Napkin.Types.Core | |
Eq AsStruct # | |
Ord AsStruct # | |
Defined in Napkin.Types.Core | |
Lift AsStruct # | |
type Rep AsStruct # | |
Defined in Napkin.Types.Core type Rep AsStruct = D1 ('MetaData "AsStruct" "Napkin.Types.Core" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "AsStruct" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AsStructNo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AsValue" 'PrefixI 'False) (U1 :: Type -> Type))) |
data ParensOperatorArgument #
Instances
data ParensOperator #
Instances
type ColumnComment = (Ref SExp, Text) #
Query | |
| |
Union | |
| |
QueryRaw RawQuery | Escape hatch: A raw query with all the dependencies contained therein. Avoid if possible. |
NativeQuery NativeQuery |
Instances
data NativeQuery #
Instances
emptyQuery :: Query #
mkUnion :: UnionType -> [Query] -> Query #
Convenience: Combine list of queries via union of the same type
collectUnionQueries :: Query -> NonEmpty Query #
Pull apart any UNIONs and extract a flat list of non-union queries.
data DefinedRelation #
OO-style wrapper for objects that contain a full query definition
forall s.(AsRelation s, HasDefinition s, MaybeQuery s) => DefinedRelation s |
Instances
AsRelation DefinedRelation # | |
Defined in Napkin.Types.Core asRelation :: DefinedRelation -> Relation # |
data DefinedQuery #
Like DefinedRelation
, but only requires a defined query.
forall s.HasDefinition s => DefinedQuery s |
class AsRelation s where #
asRelation :: s -> Relation #
Instances
AsRelation DefinedRelation # | |
Defined in Napkin.Types.Core asRelation :: DefinedRelation -> Relation # | |
AsRelation Query # | |
Defined in Napkin.Types.Core asRelation :: Query -> Relation # | |
AsRelation Relation # | |
Defined in Napkin.Types.Core asRelation :: Relation -> Relation # | |
AsRelation SpecTableName # | |
Defined in Napkin.Types.Core asRelation :: SpecTableName -> Relation # | |
AsRelation (CreateTableAs m) # | |
Defined in Napkin.Spec.Types.CreateTableAs asRelation :: CreateTableAs m -> Relation # | |
AsRelation (CreateTable m) # | |
Defined in Napkin.Types.Commands asRelation :: CreateTable m -> Relation # | |
AsRelation (CreateView meta) # | |
Defined in Napkin.Types.Commands asRelation :: CreateView meta -> Relation # | |
AsRelation (Q a) # | |
Defined in Napkin.Untyped.Monad asRelation :: Q a -> Relation # | |
AsRelation (Ref a) # | |
Defined in Napkin.Types.Core asRelation :: Ref a -> Relation # |
class HasDefinition s where #
Instances
HasDefinition Query # | |
HasDefinition (CreateTableAs m) # | |
Defined in Napkin.Spec.Types.CreateTableAs defQuery :: Lens (CreateTableAs m) (CreateTableAs m) Query Query # | |
HasDefinition (CreateTable m) # | |
Defined in Napkin.Types.Commands defQuery :: Lens (CreateTable m) (CreateTable m) Query Query # | |
HasDefinition (Q ()) # | |
class MaybeQuery s where #
Things that may or may not contain an explicit Query inside
Instances
MaybeQuery Query # | |
MaybeQuery Relation # | |
MaybeQuery (CreateTableAs m) # | |
Defined in Napkin.Spec.Types.CreateTableAs getQuery :: CreateTableAs m -> Maybe Query # | |
MaybeQuery (CreateTable m) # | |
Defined in Napkin.Types.Commands getQuery :: CreateTable m -> Maybe Query # | |
MaybeQuery (Q ()) # | |
queryFullySpecified :: Data a => a -> Bool #
Has select *
been used anywhere inside this thing? If so, False.
queryWhere :: Traversal' Query (Maybe SExp) #
querySelect :: Traversal' Query [Alias SExp] #
queryOffset :: Traversal' Query (Maybe Int) #
queryLimit :: Traversal' Query (Maybe Int) #
queryHaving :: Traversal' Query (Maybe SExp) #
_Query :: Prism' Query (WithClauses, [Alias SExp], [ColumnComment], Maybe From, Maybe ParensOperator, Maybe SExp, Maybe SExp, GroupBy, Order, Maybe Int, Maybe Int, Distinctness, AsStruct) #
_From :: Iso' From (Selected Relation, [(Selected Relation, JoinType, Either (Maybe SExp) [Ref SExp])]) #
_JoinOuter :: Prism' JoinType () #
_JoinCross :: Prism' JoinType () #
_JoinInner :: Prism' JoinType () #
_JoinRight :: Prism' JoinType () #
unRef :: forall k (a :: k) k (a :: k). Iso (Ref (a :: k)) (Ref (a :: k)) (NonEmpty Name) (NonEmpty Name) #
_Microsecond :: Prism' DatePart () #
_Millisecond :: Prism' DatePart () #
_DayOfYear :: Prism' DatePart () #
_DayOfWeek :: Prism' DatePart () #
_Millennium :: Prism' DatePart () #
_FieldAccess :: Prism' SExp (SExp, StructField) #
_ArrayItem :: Prism' SExp (ArrayBase, Nullability, SExp, SExp) #
_ArraySelect :: Prism' SExp Query #
selectItem :: forall a. Lens' (Selected a) a #
_WithClauses :: Iso' WithClauses (Bool, OMap (Ref Query) CteBody) #
Instances
Val Int64 # | Auto-convert from |
Val ByteString # | |
Defined in Napkin.Types.Core val :: Prism' Value ByteString # | |
Val DatePart # | |
Val IntInterval # | |
Defined in Napkin.Types.Core val :: Prism' Value IntInterval # | |
Val Value # | |
Val Text # | |
Val Day # | |
Val UTCTime # | |
Val String # | |
Val Integer # | |
Val Bool # | |
Val Double # | |
Val Int # | |
Val a => Val (Maybe a) # | |
interval :: [(Double, DatePart)] -> SExp #
Shorthand for using literal Doubles in making interval expressions.
Monomorphic converter to make it easy to type string literals under OverloadedStrings
fullWindow :: WOver #
Convenient starting point for full window (unbounded) for cases where not specifying window defaults to a partial window. (E.g. BigQuery)
Instances
TableRef DeleteFrom # | |
Defined in Napkin.Types.Commands | |
TableRef DropView # | |
TableRef InsertIntoQuery # | |
Defined in Napkin.Types.Commands | |
TableRef SpecTableName # | |
Defined in Napkin.Types.Core | |
TableRef (CreateTableAs m) # | |
Defined in Napkin.Spec.Types.CreateTableAs | |
TableRef (CreateTable m) # | |
Defined in Napkin.Types.Commands | |
TableRef (CreateView meta) # | |
Defined in Napkin.Types.Commands | |
TableRef (Ref Table) # | |
relationRef :: TableRef a => Getter a Relation #
asSelf :: SExp -> Selected SExp #
"Note that this is a partial function and will work only for SExps that are Var's. Please prefer varAs or as
when possible
funAs :: (SExp -> b) -> Ref b -> Selected b #
Apply function to a Ref and select it by the same name as the ref. Common use case in SELECT queries.
selectToRef :: Selected SExp -> SExp #
Use the name of a Selected
as a reference. Typically when
you've computed a field in a subquery or a previous table, and
you're now using that computation directly via its name.
selectedExps :: Traversal' [Selected a] a #
selectedNames :: Traversal' [Selected a0] String #
refName :: Traversal (Ref a) (Ref a1) String String #
Pull the last name out of a Ref. E.g. if Ref contains a schema.table_name, pull just the table_name out.
refLitName :: Traversal (Ref a) (Ref a1) SrcLitStr SrcLitStr #
Pull the last name out of a Ref e.g. if Ref "schema"."table_name"
,
pull just "table_name"
. String type preserves quotation/encoding
even after prepending/appending a string to it or modification through regex.
refJustRoot :: Ref a -> Ref a #
selectedName :: Traversal' (Selected a) Name #
aliasedNames :: HasDefinition s => Traversal' s (Ref SExp) #
viewAliasedNames :: (MaybeQuery s, Applicative f, Contravariant f) => (Ref SExp -> f (Ref SExp)) -> s -> f s #
scopeRefs :: Data b => Ref t -> b -> b #
Attach all column references within expression to given (table) reference. Note this would replace both their use as variables and in naming the aliases.
scopeExps :: Data b => Ref t -> b -> b #
Modify all variable references in the given object to use the given reference as the hierarchical source of the variable. Useful when pointing all variables to belong to a given relationtablename in a context.
modifyExterns :: Data b => (ExternFun -> SExp) -> b -> b #
Unit | Expression is at the row level |
Agg | Aggregate functions, like |
Analytic | Analytic level (some backends) |
Instances
Data AggLevel # | |
Defined in Napkin.Types.Core gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AggLevel -> c AggLevel # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AggLevel # toConstr :: AggLevel -> Constr # dataTypeOf :: AggLevel -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AggLevel) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AggLevel) # gmapT :: (forall b. Data b => b -> b) -> AggLevel -> AggLevel # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AggLevel -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AggLevel -> r # gmapQ :: (forall d. Data d => d -> u) -> AggLevel -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AggLevel -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AggLevel -> m AggLevel # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AggLevel -> m AggLevel # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AggLevel -> m AggLevel # | |
Show AggLevel # | |
Eq AggLevel # | |
Ord AggLevel # | |
Defined in Napkin.Types.Core |
data UpdateQuery #
Instances
updateQueryTarget :: Lens' UpdateQuery (Alias (Ref Table)) #
updateQuerySet :: Lens' UpdateQuery (OMap Name SExp) #
pattern NapkinTablePrefix :: (Eq a, IsString a) => a #
pattern NapkinTableSeparator :: (Eq a, IsString a) => a #
isTemporaryTable :: Ref Table -> Bool #
tmpTableNameFormat :: UTCTime -> Text -> Text #
Temporary tables name format: _np_POSIXtimestamp_token[_tablename], timestamps are used for temporary tables cleanup command
getUTCTimeTemporaryTable :: Ref Table -> Maybe UTCTime #
extracts timestamp from temporary tables name format (tmpTableNameFormat function): _np_day-utc-timestamp_seconds-utc-timestamp_token[_tablename]
getTemporaryTableName :: MonadIO m => m (Ref b) #