Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions to parse SQL.
Synopsis
- parseStatements :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra [Statement]
- parseProcSQL :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra [Statement]
- parseQueryExpr :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra QueryExpr
- parseScalarExpr :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra ScalarExpr
- data ParseFlags = ParseFlags {}
- defaultParseFlags :: ParseFlags
- data Dialect = Dialect {
- diName :: String
- diSyntaxFlavour :: SyntaxFlavour
- diCanonicalTypeNames :: [(Text, [Text])]
- diTextTypes :: [Text]
- diDatetimeTypes :: [Text]
- diNumberTypes :: [Text]
- namesForAnsiTypes :: [(Text, Text)]
- diDefaultCatalog :: Catalog
- ansiDialect :: Dialect
- data ParseErrorExtra = ParseErrorExtra {}
- parseName :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra Name
- parseNameComponent :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra NameComponent
Main
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number of the first char in the source (used in annotation) |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
Parse a list of statements
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
Parse a list of procedural sql statements
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra QueryExpr |
Parse a single query expr
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra ScalarExpr |
Parse a single scalar expr
Parsing options
data ParseFlags Source #
Settings to influence the parsing
Instances
Eq ParseFlags Source # | |
Defined in Database.HsSqlPpp.Internals.ParseInternal (==) :: ParseFlags -> ParseFlags -> Bool # (/=) :: ParseFlags -> ParseFlags -> Bool # | |
Show ParseFlags Source # | |
Defined in Database.HsSqlPpp.Internals.ParseInternal showsPrec :: Int -> ParseFlags -> ShowS # show :: ParseFlags -> String # showList :: [ParseFlags] -> ShowS # |
Dialect | |
|
Instances
Eq Dialect Source # | |
Data Dialect Source # | |
Defined in Database.HsSqlPpp.Internals.Dialect gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dialect -> c Dialect # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dialect # toConstr :: Dialect -> Constr # dataTypeOf :: Dialect -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dialect) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dialect) # gmapT :: (forall b. Data b => b -> b) -> Dialect -> Dialect # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dialect -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dialect -> r # gmapQ :: (forall d. Data d => d -> u) -> Dialect -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dialect -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # | |
Show Dialect Source # | |
errors
data ParseErrorExtra Source #
Simple wrapper to allow showing the source context of a ParseError
ParseErrorExtra | |
|
Instances
Show ParseErrorExtra Source # | |
Defined in Database.HsSqlPpp.Internals.ParseErrors showsPrec :: Int -> ParseErrorExtra -> ShowS # show :: ParseErrorExtra -> String # showList :: [ParseErrorExtra] -> ShowS # |
internals
parseName :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra Name Source #
parseNameComponent :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra NameComponent Source #