Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- parseSQL :: Dialect -> (Dialect -> FilePath -> Maybe (Int, Int) -> String -> 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 => String -> 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)
- 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 -> Either ParseErrors WindowFrame
- convertFrameRows :: FrameRows -> WindowFrameUnit
- convertFramePos :: FramePos -> Either ParseErrors 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]
Documentation
parseSQL :: Dialect -> (Dialect -> FilePath -> Maybe (Int, Int) -> String -> Either ParseErrors ast) -> (ast -> Either ParseErrors expr) -> Text -> FilePath -> Either Text expr #
parseDialectSQLSelExps :: Dialect -> ParseSQLFun [Alias SExp] #
Instances
Eq ParseExc # | |
Show ParseExc # | |
Generic ParseExc # | |
NFData ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert | |
Exception ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert toException :: ParseExc -> SomeException # fromException :: SomeException -> Maybe ParseExc # displayException :: ParseExc -> String # | |
type Rep ParseExc # | |
Defined in Napkin.Parse.SimpleSqlParser.Convert type Rep ParseExc = D1 ('MetaData "ParseExc" "Napkin.Parse.SimpleSqlParser.Convert" "napkin-0.5.12-IOJ7B058YIK5gpjD82pDT5" '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)))) |
notSupported :: HasCallStack => String -> 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] #
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 #
namesToRef :: [Name] -> Ref a #
parseFail :: FilePath -> String -> ParseErrors #
numericScalarExpr :: ScalarExpr -> Maybe Int #
convertType :: TypeName -> Type #
convertInPredValue :: InPredValue -> Either ParseErrors [SExp] #
prettyNames :: [Name] -> String #