hssqlppp-0.5.18: SQL parser and type checker

Safe HaskellNone
LanguageHaskell2010

Database.HsSqlPpp.Parser

Contents

Description

Functions to parse SQL.

Synopsis

Main

parseStatements

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

parseQueryExpr

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

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

parsePlpgsql

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 plpgsql statements (or tsql if you are using sql server dialect)

Parsing options

data ParseFlags

Settings to influence the parsing

Constructors

ParseFlags 

errors

data ParseErrorExtra

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