!&H      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGSafeHIJKLMNOSafe2J!simple-sql-parser]Used to set the dialect used for parsing and pretty printing, very unfinished at the moment.&The keyword handling works as follows:There is a list of reserved keywords. These will never parse as anything other than as a keyword, unless they are in one of the other lists.There is a list of 'identifier' keywords. These are reserved keywords, with an exception that they will parse as an identifier in a scalar expression. They won't parse as identifiers in other places, e.g. column names or aliases.There is a list of 'app' keywords. These are reserved keywords, with an exception that they will also parse in an 'app-like' construct - a regular function call, or any of the aggregate and window variations.There is a list of special type names. This list serves two purposes - it is a list of the reserved keywords which are also type names, and it is a list of all the multi word type names.Every keyword should appear in the keywords lists, and then you can add them to the other lists if you want exceptions. Most things that refer to functions, types or variables that are keywords in the ansi standard, can be removed from the keywords lists completely with little effect. With most of the actual SQL keywords, removing them from the keyword list will result in lots of valid syntax no longer parsing (and probably bad parse error messages too).In the code, all special syntax which looks identical to regular identifiers or function calls (apart from the name), is treated like a regular identifier or function call.It's easy to break the parser by removing the wrong words from the keywords list or adding the wrong words to the other lists.simple-sql-parserreserved keywordssimple-sql-parser"keywords with identifier exceptionsimple-sql-parserkeywords with app exceptionsimple-sql-parserNkeywords with type exception plus all the type names which are multiple wordssimple-sql-parserallow ansi fetch first syntaxsimple-sql-parser+allow limit keyword (mysql, postgres, ...)simple-sql-parserallow parsing ODBC syntax simple-sql-parser+allow quoting identifiers with `backquotes` simple-sql-parser0allow quoting identifiers with [square brackets] simple-sql-parser,allow identifiers with a leading at @example simple-sql-parser+allow identifiers with a leading # #example simple-sql-parser+allow positional identifiers like this: $1 simple-sql-parser#allow postgres style dollar stringssimple-sql-parser$allow strings with an e - e"example"simple-sql-parserallow postgres style symbolssimple-sql-parserallow sql server style symbolssimple-sql-parseransi sql 2011 dialectsimple-sql-parser mysql dialectsimple-sql-parserpostgresql dialectsimple-sql-parseroracle dialectsimple-sql-parsermicrosoft sql server dialect  SafeOsimple-sql-parserType to represent parse errors.simple-sql-parsercontains the error messagesimple-sql-parserfilename location for the errorsimple-sql-parser4line number and column number location for the error simple-sql-parserDformatted error with the position, error message and source context PSafePo!simple-sql-parserRepresents a lexed token"simple-sql-parser2A symbol (in ansi dialect) is one of the following!multi char symbols <> <= >= != ||single char symbols: * + -   ^ / % ~ & | ? ( ) [ ] , ; ( )#simple-sql-parserThis is an identifier or keyword. The first field is the quotes used, or nothing if no quotes were used. The quotes can be " or u& or something dialect specific like []$simple-sql-parsercThis is a prefixed variable symbol, such as :var, @var or #var (only :var is used in ansi dialect)%simple-sql-parser+This is a positional arg identifier e.g. $1&simple-sql-parserThis is a string literal. The first two fields are the -- start and end quotes, which are usually both ', but can be the character set (one of nNbBxX, or u&, U&), or a dialect specific string quoting (such as $$ in postgres)'simple-sql-parserNA number literal (integral or otherwise), stored in original format unchanged(simple-sql-parser1Whitespace, one or more of space, tab or newline.)simple-sql-parserA commented line using --, contains every character starting with the '--' and including the terminating newline character if there is one - this will be missing if the last line in the source is a line comment with no trailing newline*simple-sql-parser=A block comment, /* stuff */, includes the comment delimiters+simple-sql-parservPretty printing, if you lex a bunch of tokens, then pretty print them, should should get back exactly the same string-simple-sql-parser!Lex some SQL to a list of tokens.Qsimple-sql-parserparser for a sql token.simple-sql-parserUtility function to tell you if a list of tokens will pretty print then lex back to the same set of tokens. Used internally, might be useful for generating SQL via lexical tokens.-simple-sql-parserdialect of SQL to usesimple-sql-parser!filename to use in error messagessimple-sql-parser\line number and column number of the first character in the source to use in error messagessimple-sql-parserthe SQL source to lex !"#$%&'()*+,-.!"#$%&'()*-+, .Safe2O1simple-sql-parser]Comment. Useful when generating SQL code programmatically. The parser doesn't produce these.simple-sql-parserThe join condition.simple-sql-parseron exprsimple-sql-parserusing (column list)simple-sql-parserThe type of a join.simple-sql-parserRepresents an alias for a table valued expression, used in with queries and in from alias, e.g. select a from t u, select a from t u(b), with a(c) as select 1, select * from a.simple-sql-parser;Represents a entry in the csv of tables in the from clause.simple-sql-parserfrom t / from s.tsimple-sql-parser3from a join b, the bool is true if natural was usedsimple-sql-parserfrom (a)simple-sql-parserfrom a as b(c,d)simple-sql-parserfrom (query expr)simple-sql-parserfrom function(args)simple-sql-parserfrom lateral tsimple-sql-parser.ODBC {oj t1 left outer join t2 on expr} syntaxsimple-sql-parser(Represents an item in a group by clause.simple-sql-parser/Corresponding, an option for the set operators.simple-sql-parserQuery expression set operators.simple-sql-parser'The direction for a column in order by.simple-sql-parserRepresents the Distinct or All keywords, which can be used before a select list, in an aggregate/window function application, or in a query expression set operator.simple-sql-parser,Represents a query expression, which can be:a regular select;*a set operator (union, except, intersect);!a common table expression (with);2a table value constructor (values (1,2),(3,4)); oran explicit table (table t).simple-sql-parser&the expressions and the column aliasessimple-sql-parser%the type of an odbc literal (e.g. {d  '2000-01-01'4}), correpsonding to the letter after the opening {simple-sql-parser&represents the start or end of a frame simple-sql-parser@Represents whether a window frame clause is over rows or ranges.simple-sql-parserRepresents the frame clause of a window this can be [range | rows] frame_start or [range | rows] between frame_start and frame_endsimple-sql-parser?Represents 'nulls first' or 'nulls last' in an order by clause.simple-sql-parser)Represents one field in an order by list.simple-sql-parser"A subquery in a scalar expression.simple-sql-parserexists (query expr)simple-sql-parserunique (query expr)simple-sql-parsera scalar subquerysimple-sql-parserNUsed for 'expr in (scalar expression list)', and 'expr in (subquery)' syntax.0simple-sql-parser&Represents a type name, used in casts.;simple-sql-parserJRepresents an identifier name, which can be quoted or unquoted. examples:test -> Name Nothing "test"$"test" -> Name (Just """,""") "test" something$ -> Name (Just ("`","`") "something"![ms] -> Name (Just ("[","]") "ms"=simple-sql-parserRepresents a value expression. This is used for the expressions in select lists. It is also used for expressions in where, group by, having, order by and so on.>simple-sql-parserEa numeric literal optional decimal point, e+- integral exponent, e.g1010..110.11e512.34e-6?simple-sql-parser3string literal, with the start and end quote e.g. test -> StringLit "'" "'" "test"@simple-sql-parserPtext of interval literal, units of interval precision, e.g. interval 3 days (3)Asimple-sql-parser!prefix 'typed literal', e.g. int '42'Bsimple-sql-parser'identifier with parts separated by dotsCsimple-sql-parser#star, as in select *, t.*, count(*)Dsimple-sql-parser'Represents a ? in a parameterized queryEsimple-sql-parser.Represents an e.g. $1 in a parameterized queryFsimple-sql-parserhrepresents a host parameter, e.g. :a. The Maybe String is for the indicator, e.g. :var indicator :nlGsimple-sql-parserInfix binary operators. This is used for symbol operators (a + b), keyword operators (a and b) and multiple keyword operators (a is similar to b)Hsimple-sql-parsermPrefix unary operators. This is used for symbol operators, keyword operators and multiple keyword operators.Isimple-sql-parsernPostfix unary operators. This is used for symbol operators, keyword operators and multiple keyword operators.Jsimple-sql-parserrUsed for ternary, mixfix and other non orthodox operators. Currently used for row constructors, and for between.Ksimple-sql-parser[function application (anything that looks like c style function application syntactically)Lsimple-sql-parseraaggregate application, which adds distinct or all, and order by, to regular function applicationMsimple-sql-parseraggregates with within groupNsimple-sql-parserwindow application, which adds over (partition by a order by b) to regular function application. Explicit frames are not currently supportedOsimple-sql-parserUsed for the operators which look like functions except the arguments are separated by keywords instead of commas. The maybe is for the first unnamed argument if it is present, and the list is for the keyword argument pairs.Psimple-sql-parsercast(a as typename)Qsimple-sql-parser(case expression. both flavours supportedSsimple-sql-parserbin list literal and in subquery, if the bool is false it means not in was used ('a not in (1,2)')Tsimple-sql-parser!exists, all, any, some subqueriesWsimple-sql-parserrepresents an array access expression, or an array ctor e.g. a[3]. The first scalarExpr is the array, the second is the subscripts/ctor argsXsimple-sql-parser`this is used for the query expression version of array constructors, e.g. array(select * from t)_simple-sql-parseran odbc literal e.g. {d  '2000-01-01'}`simple-sql-parser0an odbc function call e.g. {fn CHARACTER_LENGTH(test)}asimple-sql-parserif + or - usedbsimple-sql-parser literal textesimple-sql-parseraggregate function namefsimple-sql-parserdistinctgsimple-sql-parserargshsimple-sql-parserorder byisimple-sql-parserfilterjsimple-sql-parser within groupksimple-sql-parserwindow function namelsimple-sql-parserargsmsimple-sql-parser partition bynsimple-sql-parserorder byosimple-sql-parser frame clausepsimple-sql-parser test valueqsimple-sql-parser when branchesrsimple-sql-parser else valuessimple-sql-parserHelper/ 'default'd value for query exprs to make creating query expr values a little easier. It is defined like this: |makeSelect :: QueryExpr makeSelect = Select {qeSetQuantifier = SQDefault ,qeSelectList = [] ,qeFrom = [] ,qeWhere = Nothing ,qeGroupBy = [] ,qeHaving = Nothing ,qeOrderBy = [] ,qeOffset = Nothing ,qeFetchFirst = Nothing}C123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=VWKE>?@ABCDFGHIJLMNOPQRSTUXYZ[\]^_`abcdefghijklmnopqrsC=VWKE>?@ABCDFGHIJLMNOPQRSTUXYZ[\]^_`abcdefghijklmnopqr;<0123456789:./+,-%&'()*"#$ !     sfghicdeXYZ[\]^_`ab{|}~tuvwxyzjklmnopqrsTUVWOPQRSLMNIJK=>?@AB3456789:;<FGHCDE12Safe@simple-sql-parser,Convert a query expr ast to concrete syntax.Asimple-sql-parser,Convert a value expr ast to concrete syntax.Bsimple-sql-parser+Convert a statement ast to concrete syntax.Csimple-sql-parser_Convert a list of statements to concrete syntax. A semicolon is inserted after each statement.@ABC@ABCSafePDsimple-sql-parser1Parses a query expr, trailing semicolon optional.Esimple-sql-parser0Parses a statement, trailing semicolon optional.Fsimple-sql-parser]Parses a list of statements, with semi colons between them. The final semicolon is optional.Gsimple-sql-parserParses a scalar expression.Dsimple-sql-parserdialect of SQL to usesimple-sql-parser!filename to use in error messagessimple-sql-parser\line number and column number of the first character in the source to use in error messagessimple-sql-parserthe SQL source to parseEsimple-sql-parserdialect of SQL to usesimple-sql-parser!filename to use in error messagessimple-sql-parser\line number and column number of the first character in the source to use in error messagessimple-sql-parserthe SQL source to parseFsimple-sql-parserdialect of SQL to usesimple-sql-parser!filename to use in error messagessimple-sql-parser\line number and column number of the first character in the source to use in error messagessimple-sql-parserthe SQL source to parseGsimple-sql-parserdialect of SQL to usesimple-sql-parser!filename to use in error messagessimple-sql-parser\line number and column number of the first character in the source to use in error messagessimple-sql-parserthe SQL source to parse  DEFG DGEF R      !""#$%&'()*+,-./01234567089:;<=>?@ABCDEFGHHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghiijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,,-./01234566789:;<=>+?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK.simple-sql-parser-0.6.0-BFVX8GhAbvoDwHlzu0FypKLanguage.SQL.SimpleSQL.DialectLanguage.SQL.SimpleSQL.LexLanguage.SQL.SimpleSQL.SyntaxLanguage.SQL.SimpleSQL.PrettyLanguage.SQL.SimpleSQL.Parse"Language.SQL.SimpleSQL.CombinatorsLanguage.SQL.SimpleSQL.ErrorsDialect diKeywordsdiIdentifierKeywords diAppKeywordsdiSpecialTypeNames diFetchFirstdiLimitdiOdbcdiBackquotedIdendiSquareBracketQuotedIdendiAtIdentifierdiHashIdentifierdiPositionalArgdiDollarString diEStringdiPostgresSymbolsdiSqlServerSymbolsansi2011mysqlpostgresoracle sqlserver $fEqDialect $fShowDialect $fReadDialect $fDataDialect ParseError peErrorString peFilename pePositionpeFormattedErrorTokenSymbol IdentifierPrefixedVariable PositionalArg SqlString SqlNumber Whitespace LineComment BlockComment prettyToken prettyTokenslexSQLtokenListWillPrintAndLex $fEqToken $fShowTokenCommentPrivilegeActionPrivAll PrivSelect PrivDelete PrivInsert PrivUpdatePrivReferences PrivUsage PrivTrigger PrivExecutePrivilegeObject PrivTable PrivDomainPrivType PrivSequence PrivFunctionGrantOptionForNoGrantOptionForAdminOptionForNoAdminOptionFor GrantOptionWithGrantOptionWithoutGrantOption AdminOptionWithAdminOptionWithoutAdminOptionAlterDomainAction ADSetDefault ADDropDefaultADAddConstraintADDropConstraint CheckOptionDefaultCheckOptionCascadedCheckOptionLocalCheckOptionSequenceGeneratorOption SGODataType SGOStartWith SGORestartSGOIncrementBy SGOMaxValue SGONoMaxValue SGOMinValue SGONoMinValueSGOCycle SGONoCycle IdentityWhenGeneratedAlwaysGeneratedByDefault DefaultClauseIdentityColumnSpecGenerationClauseAlterTableAction AddColumnDefAlterColumnSetDefaultAlterColumnDropDefaultAlterColumnSetNotNullAlterColumnDropNotNullAlterColumnSetDataType DropColumnAddTableConstraintDefDropTableConstraintDefReferentialActionDefaultReferentialAction RefCascade RefSetNull RefSetDefault RefRestrict RefNoActionReferenceMatchDefaultReferenceMatch MatchFull MatchPartial MatchSimpleTableConstraintTableUniqueConstraintTablePrimaryKeyConstraintTableReferencesConstraintTableCheckConstraint ColConstraintColNotNullConstraintColUniqueConstraintColPrimaryKeyConstraintColReferencesConstraintColCheckConstraintColConstraintDef ColumnDef TableElementTableColumnDefTableConstraintDef SetClauseSet SetMultiple InsertSource InsertQueryDefaultInsertValuesIdentityRestartContinueIdentityRestartIdentityDefaultIdentityRestart DropBehaviourRestrictCascadeDefaultDropBehaviour Statement CreateSchema DropSchema CreateTable AlterTable DropTable CreateViewDropView CreateDomain AlterDomain DropDomainCreateAssertion DropAssertionCreateSequence AlterSequence DropSequenceSelectStatementDeleteTruncateInsertUpdateGrantPrivilege GrantRole CreateRoleDropRoleRevokePrivilege RevokeRoleStartTransaction SavepointReleaseSavepointCommitRollbackStatementComment JoinConditionJoinOn JoinUsingJoinTypeJInnerJLeftJRightJFullJCrossAliasTableRefTRSimpleTRJoinTRParensTRAlias TRQueryExpr TRFunction TRLateralTROdbc GroupingExprGroupingParensCubeRollup GroupingSets SimpleGroup Corresponding RespectivelySetOperatorNameUnionExcept Intersect Direction DirDefaultAscDesc SetQuantifier SQDefaultDistinctAll QueryExprSelectQueryExprSetOpWithValuesTable QECommentqeSetQuantifier qeSelectListqeFromqeWhere qeGroupByqeHaving qeOrderByqeOffset qeFetchFirstqe0qeCombOpqeCorrespondingqe1qeWithRecursiveqeViewsqeQueryExpressionOdbcLiteralTypeOLDateOLTime OLTimestampFramePosUnboundedPreceding PrecedingCurrent FollowingUnboundedFollowing FrameRows FrameRangeFrame FrameFrom FrameBetween NullsOrderNullsOrderDefault NullsFirst NullsLastSortSpecCompPredQuantifierCPAnyCPSomeCPAllSubQueryExprTypeSqExistsSqUniqueSqSq InPredValueInList InQueryExpr PrecUnitsPrecCharacters PrecOctetsPrecMultiplierPrecKPrecMPrecGPrecTPrecPSignPlusMinusIntervalTypeFieldItfTypeName PrecTypeNamePrecScaleTypeNamePrecLengthTypeName CharTypeName TimeTypeName RowTypeNameIntervalTypeName ArrayTypeNameMultisetTypeNameName ScalarExprNumLit StringLit IntervalLitTypedLitIdenStar Parameter HostParameterBinOpPrefixOp PostfixOp SpecialOpApp AggregateAppAggregateAppGroup WindowApp SpecialOpKCastCaseParensIn SubQueryExprQuantifiedComparisonMatchArray ArrayCtorCollate MultisetBinOp MultisetCtorMultisetQueryCtor NextValueFor VEComment OdbcLiteralOdbcFuncilSign ilLiteralilFromilToaggName aggDistinctaggArgs aggOrderBy aggFilteraggGroupwnNamewnArgs wnPartition wnOrderBywnFramecaseTest caseWhenscaseElse makeSelect$fEqName $fShowName $fReadName $fDataName$fEqIntervalTypeField$fShowIntervalTypeField$fReadIntervalTypeField$fDataIntervalTypeField$fEqSign $fShowSign $fReadSign $fDataSign$fEqPrecMultiplier$fShowPrecMultiplier$fReadPrecMultiplier$fDataPrecMultiplier $fEqPrecUnits$fShowPrecUnits$fReadPrecUnits$fDataPrecUnits $fEqTypeName$fShowTypeName$fReadTypeName$fDataTypeName$fEqSubQueryExprType$fShowSubQueryExprType$fReadSubQueryExprType$fDataSubQueryExprType$fEqCompPredQuantifier$fShowCompPredQuantifier$fReadCompPredQuantifier$fDataCompPredQuantifier$fEqNullsOrder$fShowNullsOrder$fReadNullsOrder$fDataNullsOrder $fEqFrameRows$fShowFrameRows$fReadFrameRows$fDataFrameRows$fEqOdbcLiteralType$fShowOdbcLiteralType$fReadOdbcLiteralType$fDataOdbcLiteralType$fEqSetQuantifier$fShowSetQuantifier$fReadSetQuantifier$fDataSetQuantifier $fEqDirection$fShowDirection$fReadDirection$fDataDirection$fEqSetOperatorName$fShowSetOperatorName$fReadSetOperatorName$fDataSetOperatorName$fEqCorresponding$fShowCorresponding$fReadCorresponding$fDataCorresponding $fEqAlias $fShowAlias $fReadAlias $fDataAlias $fEqJoinType$fShowJoinType$fReadJoinType$fDataJoinType$fEqDropBehaviour$fShowDropBehaviour$fReadDropBehaviour$fDataDropBehaviour$fEqIdentityRestart$fShowIdentityRestart$fReadIdentityRestart$fDataIdentityRestart$fEqReferenceMatch$fShowReferenceMatch$fReadReferenceMatch$fDataReferenceMatch$fEqReferentialAction$fShowReferentialAction$fReadReferentialAction$fDataReferentialAction$fEqIdentityWhen$fShowIdentityWhen$fReadIdentityWhen$fDataIdentityWhen$fEqSequenceGeneratorOption$fShowSequenceGeneratorOption$fReadSequenceGeneratorOption$fDataSequenceGeneratorOption$fEqCheckOption$fShowCheckOption$fReadCheckOption$fDataCheckOption$fEqAdminOption$fShowAdminOption$fReadAdminOption$fDataAdminOption$fEqGrantOption$fShowGrantOption$fReadGrantOption$fDataGrantOption$fEqAdminOptionFor$fShowAdminOptionFor$fReadAdminOptionFor$fDataAdminOptionFor$fEqGrantOptionFor$fShowGrantOptionFor$fReadGrantOptionFor$fDataGrantOptionFor$fEqPrivilegeObject$fShowPrivilegeObject$fReadPrivilegeObject$fDataPrivilegeObject$fEqPrivilegeAction$fShowPrivilegeAction$fReadPrivilegeAction$fDataPrivilegeAction $fEqComment $fShowComment $fReadComment $fDataComment$fEqScalarExpr$fShowScalarExpr$fReadScalarExpr$fDataScalarExpr $fEqQueryExpr$fShowQueryExpr$fReadQueryExpr$fDataQueryExpr $fEqTableRef$fShowTableRef$fReadTableRef$fDataTableRef$fEqJoinCondition$fShowJoinCondition$fReadJoinCondition$fDataJoinCondition$fEqGroupingExpr$fShowGroupingExpr$fReadGroupingExpr$fDataGroupingExpr $fEqSortSpec$fShowSortSpec$fReadSortSpec$fDataSortSpec $fEqFrame $fShowFrame $fReadFrame $fDataFrame $fEqFramePos$fShowFramePos$fReadFramePos$fDataFramePos$fEqInPredValue$fShowInPredValue$fReadInPredValue$fDataInPredValue$fEqAlterDomainAction$fShowAlterDomainAction$fReadAlterDomainAction$fDataAlterDomainAction$fEqDefaultClause$fShowDefaultClause$fReadDefaultClause$fDataDefaultClause$fEqTableConstraint$fShowTableConstraint$fReadTableConstraint$fDataTableConstraint$fEqColConstraint$fShowColConstraint$fReadColConstraint$fDataColConstraint$fEqColConstraintDef$fShowColConstraintDef$fReadColConstraintDef$fDataColConstraintDef $fEqColumnDef$fShowColumnDef$fReadColumnDef$fDataColumnDef$fEqAlterTableAction$fShowAlterTableAction$fReadAlterTableAction$fDataAlterTableAction$fEqTableElement$fShowTableElement$fReadTableElement$fDataTableElement $fEqSetClause$fShowSetClause$fReadSetClause$fDataSetClause$fEqInsertSource$fShowInsertSource$fReadInsertSource$fDataInsertSource $fEqStatement$fShowStatement$fReadStatement$fDataStatementprettyQueryExprprettyScalarExprprettyStatementprettyStatementsparseQueryExprparseStatementparseStatementsparseScalarExpr optionSuffix<$$><$$$><$$$$><$$$$$>convParseErrorsqlToken