Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data ParseExc
- class ParseSQL backend where
- parseSQLStatement :: ParseSQLFun backend Query
- parseSQLSExp :: ParseSQLFun backend SExp
- parseSQLSelExps :: ParseSQLFun backend [Alias SExp]
- parseSQLFrom :: ParseSQLFun backend From
- parseSQLRelation :: ParseSQLFun backend (Alias Relation)
- type ParseSQLFun backend a = backend -> String -> FilePath -> Either ParseErrors a
- notSupported :: HasCallStack => String -> a
- badSyntax :: HasCallStack => String -> a
- parsedAsQuery :: FilePath -> Statement -> Either ParseErrors Query
- convertSetQuantifier :: SetQuantifier -> Q ()
- convertQueryExpr :: QueryExpr -> Q ()
- convertSetQuantifierForSetOperatorName :: SetOperatorName -> SetQuantifier -> UnionType
- convertCorresponding :: Corresponding -> Q ()
- convertSelect :: [(ScalarExpr, Maybe Name)] -> Q [Ref SExp]
- convertFrom :: TableRef -> Q (Ref Relation)
- convertWhere :: Maybe ScalarExpr -> Q ()
- convertGroupBy :: [GroupingExpr] -> Q ()
- convertHaving :: Maybe ScalarExpr -> Q ()
- convertGroupingExpr :: GroupingExpr -> SExp
- tableAsRelation :: TableRef -> Alias Relation
- nameAsString :: Name -> String
- idenNamesAsSExp :: [Name] -> Either ParseErrors SExp
- scalarExprAsSExp :: ScalarExpr -> Either ParseErrors SExp
- convertSortSpec :: SortSpec -> Either ParseErrors OrderPart
- convertOrderBy :: [SortSpec] -> Q ()
- convertOffset :: Maybe ScalarExpr -> Q ()
- convertFetchFirst :: Maybe ScalarExpr -> Q ()
- convertDirection :: Direction -> OrderDir
- convertNullsOrder :: NullsOrder -> Maybe NullOrder
- convertFrame :: Frame -> WindowFrame
- convertFramePos :: FramePos -> FrameLength
- namesToRef :: [Name] -> Ref a
- nameToRef :: Name -> Ref a
- parseFail :: FilePath -> String -> ParseErrors
- numericScalarExpr :: ScalarExpr -> Maybe Int
- convertType :: TypeName -> Type
- convertInPredValue :: InPredValue -> Either ParseErrors [SExp]
- convertIntervalTypeField :: IntervalTypeField -> DatePart
- prettyNames :: [Name] -> String
- convertNullsRespect :: Maybe NullsRespect -> Maybe NullStrategy
- convertNullsRespectFunMod :: Maybe NullsRespect -> [FunModifier]
- type ParseErrors = ParseErrorBundle SQLTokenStream Void
Documentation
Instances
Eq ParseExc # | |
Show ParseExc # | |
Generic ParseExc # | |
NFData ParseExc # | |
Defined in Napkin.Parse.Base | |
Exception ParseExc # | |
Defined in Napkin.Parse.Base toException :: ParseExc -> SomeException # fromException :: SomeException -> Maybe ParseExc # displayException :: ParseExc -> String # | |
type Rep ParseExc # | |
Defined in Napkin.Parse.Base type Rep ParseExc = D1 ('MetaData "ParseExc" "Napkin.Parse.Base" "napkin-0.5.10-C0Hygrce3goLKcQ6g1wIUX" 'False) (C1 ('MetaCons "UnimplementedError" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FeatureNotSupportedError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "SyntaxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
class ParseSQL backend where #
parseSQLStatement :: ParseSQLFun backend Query #
parseSQLSExp :: ParseSQLFun backend SExp #
parseSQLSelExps :: ParseSQLFun backend [Alias SExp] #
parseSQLFrom :: ParseSQLFun backend From #
parseSQLRelation :: ParseSQLFun backend (Alias Relation) #
type ParseSQLFun backend a = backend -> String -> FilePath -> Either ParseErrors a #
notSupported :: HasCallStack => String -> a #
badSyntax :: HasCallStack => String -> a #
parsedAsQuery :: FilePath -> Statement -> Either ParseErrors Query #
Convert a SimpleSQL QueryExpr into a Napkin Query.
convertSetQuantifier :: SetQuantifier -> Q () #
convertQueryExpr :: QueryExpr -> Q () #
convertCorresponding :: Corresponding -> Q () #
convertSelect :: [(ScalarExpr, Maybe Name)] -> Q [Ref SExp] #
convertWhere :: Maybe ScalarExpr -> Q () #
convertGroupBy :: [GroupingExpr] -> Q () #
convertHaving :: Maybe ScalarExpr -> Q () #
convertGroupingExpr :: GroupingExpr -> SExp #
tableAsRelation :: TableRef -> Alias Relation #
nameAsString :: Name -> String #
idenNamesAsSExp :: [Name] -> Either ParseErrors SExp #
scalarExprAsSExp :: ScalarExpr -> Either ParseErrors SExp #
Convert an SQL ScalarExpr to napkin's SExp
convertOrderBy :: [SortSpec] -> Q () #
convertOffset :: Maybe ScalarExpr -> Q () #
convertFetchFirst :: Maybe ScalarExpr -> Q () #
convertDirection :: Direction -> OrderDir #
convertFrame :: Frame -> WindowFrame #
convertFramePos :: FramePos -> FrameLength #
namesToRef :: [Name] -> Ref a #
parseFail :: FilePath -> String -> ParseErrors #
numericScalarExpr :: ScalarExpr -> Maybe Int #
convertType :: TypeName -> Type #
convertInPredValue :: InPredValue -> Either ParseErrors [SExp] #
prettyNames :: [Name] -> String #