Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- parseSQL :: forall ast expr. Data ast => Dialect -> (Dialect -> FilePath -> Text -> Either ParseErrors ast) -> (ast -> Either ParseErrors expr) -> Text -> FilePath -> Either Text expr
- parseDialectSQLStatement :: Dialect -> ParseSQLFun Query
- parseDialectSQLSExp :: Dialect -> ParseSQLFun SExp
- parseDialectSQLFrom :: Dialect -> ParseSQLFun From
- parseDialectSQLRelation :: Dialect -> ParseSQLFun (Alias Relation)
- parseDialectSQLSelExps :: Dialect -> ParseSQLFun [Alias SExp]
- data ParseExc
- notSupported :: HasCallStack => Text -> a
- badSyntax :: HasCallStack => String -> a
- parsedAsQuery :: FilePath -> Statement -> Either ParseErrors Query
- convertAsStruct :: AsStruct -> Q ()
- 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)
- adaptTableOperator :: ParensOperator -> ParensOperator
- convertTableOperator :: Maybe ParensOperator -> Q ()
- convertWhere :: Maybe ScalarExpr -> Q ()
- convertGroupBy :: [GroupingExpr] -> Q ()
- convertHaving :: Maybe ScalarExpr -> Q ()
- convertGroupingExpr :: GroupingExpr -> SExp
- tableAsRelation :: TableRef -> Alias Relation
- 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 -> Either ParseErrors WindowFrame
- convertFrameRows :: FrameRows -> WindowFrameUnit
- convertFramePos :: FramePos -> Either ParseErrors FrameLength
- namesToRef :: [Name] -> Ref a
- nameToRef :: Name -> Ref a
- fromAstStr :: SrcLitStr -> Name
- parseFail :: FilePath -> String -> ParseErrors
- numericScalarExpr :: ScalarExpr -> Maybe Int
- convertType :: TypeName -> Type
- convertInPredValue :: InPredValue -> Either ParseErrors [SExp]
- convertIntervalTypeField :: IntervalTypeField -> DatePart
- prettyNames :: [Name] -> Text
- convertNullsRespect :: Maybe NullsRespect -> Maybe NullStrategy
- convertNullsRespectFunMod :: Maybe NullsRespect -> [FunModifier]
Documentation
parseSQL :: forall ast expr. Data ast => Dialect -> (Dialect -> FilePath -> Text -> Either ParseErrors ast) -> (ast -> Either ParseErrors expr) -> Text -> FilePath -> Either Text expr #
parseDialectSQLSelExps :: Dialect -> ParseSQLFun [Alias SExp] #
Instances
Exception ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert toException :: ParseExc -> SomeException # fromException :: SomeException -> Maybe ParseExc # displayException :: ParseExc -> String # | |
Generic ParseExc # | |
Show ParseExc # | |
NFData ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert | |
Eq ParseExc # | |
type Rep ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert type Rep ParseExc = D1 ('MetaData "ParseExc" "Napkin.Parse.SimpleSqlParser.Convert" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) (C1 ('MetaCons "UnimplementedError" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FeatureNotSupportedError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "SyntaxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
notSupported :: HasCallStack => Text -> a #
badSyntax :: HasCallStack => String -> a #
parsedAsQuery :: FilePath -> Statement -> Either ParseErrors Query #
Convert a SimpleSQL QueryExpr into a Napkin Query.
convertAsStruct :: AsStruct -> Q () #
convertSetQuantifier :: SetQuantifier -> Q () #
convertQueryExpr :: QueryExpr -> Q () #
convertCorresponding :: Corresponding -> Q () #
convertSelect :: [(ScalarExpr, Maybe Name)] -> Q [Ref SExp] #
convertTableOperator :: Maybe ParensOperator -> Q () #
convertWhere :: Maybe ScalarExpr -> Q () #
convertGroupBy :: [GroupingExpr] -> Q () #
convertHaving :: Maybe ScalarExpr -> Q () #
convertGroupingExpr :: GroupingExpr -> SExp #
tableAsRelation :: TableRef -> Alias Relation #
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 #
namesToRef :: [Name] -> Ref a #
fromAstStr :: SrcLitStr -> Name #
parseFail :: FilePath -> String -> ParseErrors #
numericScalarExpr :: ScalarExpr -> Maybe Int #
convertType :: TypeName -> Type #
convertInPredValue :: InPredValue -> Either ParseErrors [SExp] #
prettyNames :: [Name] -> Text #