txt-sushi-0.4.0: Spreadsheets are databases!

Portabilityportable
Stabilityexperimental
Maintainerkeithshep@gmail.com

Database.TxtSushi.SQLParser

Description

Module for parsing SQL

Synopsis

Documentation

allMaybeTableNames :: Maybe TableExpression -> [String]Source

convenience function for extracting all of the table names used by the given table expression

parseSelectStatement :: GenParser Char st SelectStatementSource

Parses a SQL select statement

data SelectStatement Source

represents a select statement TODO this should be moved inside the TableExpression type

prettyFormatColumn :: ColumnIdentifier -> StringSource

I wanted to leave the default Show, but I also wanted a pretty print, so here it is!

withTrailing :: Monad m => m a -> m b -> m bSource

withoutTrailing :: Show s => GenParser tok st s -> GenParser tok st a -> GenParser tok st aSource

isAggregate :: SQLFunction -> BoolSource

an aggregate function is one whose min function count is 1 and whose arg count is not fixed

substringFromFunction :: SQLFunctionSource

SUBSTRING(extraction_string FROM starting_position [FOR length] [COLLATE collation_name]) TODO implement COLLATE part

maybeReadInt :: String -> Maybe IntSource

returns an int if it can be read from the string

maybeReadReal :: String -> Maybe DoubleSource

returns a real if it can be read from the string