hssqlppp-0.6.0: SQL parser and type checker

Safe HaskellNone
LanguageHaskell2010

Database.HsSqlPpp.Parse

Contents

Description

Functions to parse SQL.

Synopsis

Main

parseStatements Source

Arguments

:: 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

parseProcSQL Source

Arguments

:: 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

parseQueryExpr Source

Arguments

:: 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

parseScalarExpr Source

Arguments

:: 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

Constructors

ParseFlags 

Fields

pfDialect :: Dialect
 

errors

data ParseErrorExtra Source

Simple wrapper to allow showing the source context of a ParseError

Constructors

ParseErrorExtra 

Fields

parseErrorError :: ParseError

wrapped error

parseErrorPosition :: Maybe (Int, Int)

source position adjustment to get the context bit in error messages right - this is the same as what is passed into parseSqlWithPosition

parseErrorSqlSource :: Text

sql source

internals