Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convert the simple BigQuery AST to an SQL query, ready to be passed to the odbc package's query/exec functions.
Synopsis
- data Printer
- (<+>) :: Printer -> Printer -> Printer
- fromExpression :: Expression -> Printer
- fromScalarType :: ScalarType -> Printer
- fromOp :: Op -> Printer
- fromPath :: JsonPath -> Printer
- fromFieldName :: FieldName -> Printer
- fromSelect :: Select -> Printer
- fromOn :: (FieldName, FieldName) -> Printer
- fromJoinSource :: JoinSource -> Printer
- fromReselect :: Reselect -> Printer
- fromOrderBys :: Top -> Maybe Expression -> Maybe (NonEmpty OrderBy) -> Printer
- fromOrderBy :: OrderBy -> Printer
- fromOrder :: Order -> Printer
- fromNullsOrder :: NullsOrder -> Printer
- fromJoinAlias :: EntityAlias -> Printer
- fromProjection :: Projection -> Printer
- fromFieldOrigin :: FieldOrigin -> Printer
- fromWindowFunction :: WindowFunction -> Printer
- fromArrayAgg :: ArrayAgg -> Printer
- fromNullAggregate :: Aggregate -> Printer
- fromAggregate :: Aggregate -> Printer
- fromCountable :: Countable FieldName -> Printer
- fromWhere :: Where -> Printer
- fromSelectJson :: SelectJson -> Printer
- fromFrom :: From -> Printer
- fromTableName :: TableName -> Printer
- fromFunctionName :: FunctionName -> Printer
- fromAliased :: Aliased Printer -> Printer
- fromNameText :: Text -> Printer
- trueExpression :: Expression
- falseExpression :: Expression
- fromValue :: Value -> Printer
- parens :: Printer -> Printer
- toBuilderFlat :: Printer -> Builder
- toBuilderPretty :: Printer -> Builder
- toTextPretty :: Printer -> Text
- toTextFlat :: Printer -> Text
- renderBuilderFlat :: Printer -> (Builder, InsOrdHashMap Int Value)
- renderBuilderPretty :: Printer -> (Builder, InsOrdHashMap Int Value)
- paramName :: Int -> Builder
- runBuilderFlat :: Printer -> State (InsOrdHashMap Value Int) Builder
- runBuilderPretty :: Printer -> State (InsOrdHashMap Value Int) Builder
- cleanProjections :: NonEmpty Projection -> NonEmpty Projection
Documentation
SeqPrinter [Printer] | |
SepByPrinter Printer [Printer] | |
NewlinePrinter | |
UnsafeTextPrinter Text | |
IndentPrinter Int Printer | |
ValuePrinter Value |
fromExpression :: Expression -> Printer Source #
fromScalarType :: ScalarType -> Printer Source #
fromFieldName :: FieldName -> Printer Source #
fromSelect :: Select -> Printer Source #
fromJoinSource :: JoinSource -> Printer Source #
fromReselect :: Reselect -> Printer Source #
fromOrderBys :: Top -> Maybe Expression -> Maybe (NonEmpty OrderBy) -> Printer Source #
fromOrderBy :: OrderBy -> Printer Source #
fromNullsOrder :: NullsOrder -> Printer Source #
fromJoinAlias :: EntityAlias -> Printer Source #
fromProjection :: Projection -> Printer Source #
fromFieldOrigin :: FieldOrigin -> Printer Source #
fromArrayAgg :: ArrayAgg -> Printer Source #
fromNullAggregate :: Aggregate -> Printer Source #
fromAggregate :: Aggregate -> Printer Source #
fromSelectJson :: SelectJson -> Printer Source #
fromTableName :: TableName -> Printer Source #
fromNameText :: Text -> Printer Source #
toBuilderFlat :: Printer -> Builder Source #
toBuilderPretty :: Printer -> Builder Source #
toTextPretty :: Printer -> Text Source #
toTextFlat :: Printer -> Text Source #
renderBuilderFlat :: Printer -> (Builder, InsOrdHashMap Int Value) Source #
Produces a query with holes, and a mapping for each
renderBuilderPretty :: Printer -> (Builder, InsOrdHashMap Int Value) Source #
Produces a query with holes, and a mapping for each
cleanProjections :: NonEmpty Projection -> NonEmpty Projection Source #
TODO: For now, we're littering this around where projections are built. I'd prefer to use ordered set, or else a newtype wrapper to prove it's been sorted. But that would interrupt code elsewhere. For now, this is an acceptable solution. Plus, a warning issued about duplicates might be useful.
Orphan instances
ToJSON Expression Source # | |
toJSON :: Expression -> Value toEncoding :: Expression -> Encoding toJSONList :: [Expression] -> Value toEncodingList :: [Expression] -> Encoding |