Jake Wheat
9f2ff37c54
fix regression in extract function parsing, some small tweaks
2019-08-31 18:12:35 +01:00
Jake Wheat
ca910b8e6d
tweaks to the keyword list and handling
2019-08-31 16:15:17 +01:00
Jake Wheat
4c8f612f56
fix some warnings, small tweaks to the build
2019-08-31 13:41:07 +01:00
Jake Wheat
020b33e729
improve the dialect handling to be more feature based
2019-08-31 13:40:23 +01:00
Jake Wheat
ee432d79ba
update handling of fetch first and limit wrt dialects
2019-08-31 12:38:24 +01:00
Jake Wheat
eb45eb8705
start refactoring the dialect support, and work on the keyword handling
2019-08-31 11:57:28 +01:00
Jake Wheat
3707a09cb8
allow current_timestamp to be parsed, bump version
2019-08-31 10:08:02 +01:00
Jake Wheat
9f4a457a4d
fix extra 'as' when printing ctes
2019-08-31 09:30:42 +01:00
Jake Wheat
ce0eeb392a
fix parsing of quoted keywords
2019-08-31 09:13:09 +01:00
Jake Wheat
525a1a8652
fixes to docs
2019-07-07 13:46:39 +01:00
Jake Wheat
8e9b9edd0c
add window functions to the keyword parser hack so they work, bug #18
2019-07-07 13:08:02 +01:00
Jonas Scholl
9631a3d1ba
Update for base-4.11 compatibility.
2018-07-11 22:37:18 +02:00
Jake Wheat
ff3dcb814c
add support for oracle type size units 'char' and 'byte', example: varchar2(55 byte)
2016-08-10 11:27:30 +03:00
Jake Wheat
7f08e51c74
add comments to statement syntax
2016-02-22 23:28:59 +02:00
Jake Wheat
c56a1c8fc8
use explicit data type for sign in interval literals
2016-02-22 23:25:00 +02:00
Jake Wheat
d52b5efc8b
rename CombineQueryExpr to QueryExprSetOp and CombineOp to SetOperatorName
2016-02-22 23:24:43 +02:00
Jake Wheat
a2645ace3f
rename ValueExpr to ScalarExpr
2016-02-22 23:24:25 +02:00
Jake Wheat
09223c3de9
refactor the identifier lexer a bit
2016-02-22 23:24:02 +02:00
Jake Wheat
9457720d2c
refactor the symbol lexer more
2016-02-22 23:23:42 +02:00
Jake Wheat
a3178ad249
refactor the symbol lexer a little
2016-02-22 23:20:11 +02:00
Jake Wheat
3f7e0123a2
a few documentation and website tweaks
2016-02-22 23:16:36 +02:00
Jake Wheat
92c537fce2
move #iden to sql server dialect
2016-02-21 23:50:23 +02:00
Jake Wheat
83b16edb1f
add support for odbc outer join syntax
2016-02-21 23:48:55 +02:00
Jake Wheat
c8d745fd28
add support for odbc scalar exprs
2016-02-21 23:43:19 +02:00
Jake Wheat
d8b351472f
add positional arg to the syntax and parser
2016-02-21 23:36:47 +02:00
Jake Wheat
64d3b742b4
make aggregate function names non keywords
2016-02-18 20:38:59 +02:00
Jake Wheat
c0b4358d89
parse functions whose name is a keyword
2016-02-18 20:37:12 +02:00
Jake Wheat
90e66f4888
reorder identifier-like parser code in lex
2016-02-18 20:32:32 +02:00
Jake Wheat
ba55859dd7
special case in the lexer to support postgres 1..2
2016-02-18 20:29:45 +02:00
Jake Wheat
31914dfd83
add some notes
2016-02-15 20:36:01 +02:00
Jake Wheat
ee4098e189
lexer tweaks
...
combine hostparam with prefixed variable
refactor some of the lexing code slightly
fix error in tests where it was using the ansi dialect instead of
postgres for testing :::, etc.
2016-02-15 20:35:38 +02:00
Jake Wheat
31f9912faa
lexer tweaks
...
refactor dollarstring parser
fix to not allow three or more adjacent colons in postgres dialect
2016-02-15 20:34:58 +02:00
Jake Wheat
b4c2276a1f
tidy up the tokensWillPrintAndLex function some more
2016-02-15 20:34:28 +02:00
Jake Wheat
36109ce584
refactor the tokenswillprintandlex utility function
2016-02-15 20:34:04 +02:00
Jake Wheat
a4d91b3e44
add support for odbc symbols: {} in lexer
2016-02-15 20:33:37 +02:00
Jake Wheat
9adce162e5
add support for [] quoted identifiers and for #var, @var
2016-02-15 20:33:11 +02:00
Jake Wheat
b22cde4100
add support for @var and #var in sqlserver and oracle dialects respectively
2016-02-15 20:32:26 +02:00
Jake Wheat
9fd2970f26
work on lexing: error cases
...
fix so following a number with either . or e or E without whitespace
will cause a lexing error
remove */ from symbols in postgres (although postgres strictly
speaking allows this I think, it is not a good idea)
reject */ anywhere with an error
reject ||| (or more pipes) in ansi, etc. dialects instead of trying to
parse it as something like '||', '|'
2016-02-15 20:31:06 +02:00
Jake Wheat
4bca2fa2ec
work on lexing
...
add utility function to tell if two tokens will pretty print then lex
back to the same two tokens or not
add notes for some final missing lexing bits that are in hssqlppp
add token combo tests for postgres
add start of sql server, oracle and odbc lexing tests
2016-02-15 20:20:24 +02:00
Jake Wheat
47198c78c1
add tests for + - followed by comment edge cases
2016-02-13 20:38:49 +02:00
Jake Wheat
fc2119be02
refactor postgresql operator parsing
2016-02-13 20:34:50 +02:00
Jake Wheat
c24008444c
work on postgres operator parsing
2016-02-13 20:28:12 +02:00
Jake Wheat
5084c0c3ab
add lexing for \' only in e' strings and dollar strings in pg dialect
2016-02-13 17:07:27 +02:00
Jake Wheat
b41803427d
work on postgresql lexing
...
add positional arg
add e' quoted strings
add \' escaping in strings (not finished)
add ::, :=, : symbols
2016-02-13 16:31:20 +02:00
Jake Wheat
a59f19aae9
don't unescape quotes in string literals and identifiers
2016-02-13 15:54:40 +02:00
Jake Wheat
f17053c7d9
add notes to lex.lhs
2016-02-13 11:40:49 +02:00
Jake Wheat
aa5c2e89c7
refactor the identifier syntax
2016-02-12 14:13:47 +02:00
Jake Wheat
52f035b718
new syntax for names and string literals
2016-02-12 13:09:58 +02:00
Jake Wheat
1b4eefc431
refactor dialect into a non enum and separate to own file
2016-02-12 12:51:06 +02:00
Jake Wheat
2b73907119
rename modules lexer->lex, parser->parse
2016-02-12 12:22:19 +02:00
Jake Wheat
5b786bd11d
small tweaks
2016-02-12 11:57:09 +02:00
Jake Wheat
c102528d5f
add create and drop assertion
2015-08-16 20:03:02 +03:00
Jake Wheat
3c0788af6e
add support for create/drop role, grant, revoke
2015-08-15 21:01:48 +03:00
Jake Wheat
c35ea6e08b
small fixes and update changelog
2015-08-09 20:13:11 +03:00
Jake Wheat
2c817f4088
fix silly bug with is distinct from parsing
2015-08-05 22:57:36 +03:00
Jake Wheat
136257bfd5
fixes to operator precedence, introduced some bugs to fix also
2015-08-05 22:38:44 +03:00
Jake Wheat
666d1f877f
add basic transction control
2015-08-04 22:53:08 +03:00
Jake Wheat
a9d51d1ebb
add create,alter,drop sequence
2015-08-04 22:35:51 +03:00
Jake Wheat
9aab04b189
add create, alter, drop domain
2015-08-04 22:08:32 +03:00
Jake Wheat
c2810cddd2
add support for create and drop view
2015-08-02 23:52:01 +03:00
Jake Wheat
8291fbaa44
add drop table support
2015-08-02 23:27:09 +03:00
Jake Wheat
f0baa3c37b
add alter table variations:
...
set default
drop default
set not null
drop not null
set data type
drop column
add constraint
drop constraint
fix bug where generated didn't have to be followed with 'always' or
'by default' for identities in create table
2015-08-02 23:22:06 +03:00
Jake Wheat
f6477ac214
add alter table add column support
2015-08-02 20:56:39 +03:00
Jake Wheat
fa1df4c7a2
add table constraint definitions to create table
2015-08-02 20:36:05 +03:00
Jake Wheat
e6e8264b3d
add support for column constraints in create table
2015-08-02 19:27:39 +03:00
Jake Wheat
4f80ec96d4
add generation clause support to create table
2015-08-02 18:14:45 +03:00
Jake Wheat
e495e240c0
add default and identity to create table
2015-08-02 18:04:40 +03:00
Jake Wheat
3b5deec2e5
fix positioning in lexer? and fix line comment token missing trailing \n
2015-08-02 15:29:35 +03:00
Jake Wheat
6802aaef5a
add simple create table support
2015-08-01 23:16:26 +03:00
Jake Wheat
dfa84072dc
start adding basic dml
...
parser and pretty printer for statements
add query statement
add support for
insert
update
delete
truncate
bonus ddl:
limited create schema
drop schema
add grammar notes to the new test files
2015-08-01 20:26:00 +03:00
Jake Wheat
6fc8869f73
preparation for non-queries
...
some docs in the lexer
bump the version to 0.5.0
add placeholder files for the planned initial non query support
2015-08-01 18:08:54 +03:00
Jake Wheat
bbb793c160
small fixes
...
fix positions?
small fixes to haddock
add notes to top of lexer module
simplify line comment lexer
remove some trys from lexer
fix the block comment parser to return all the comment text when there
are embedded / * in the comment
refactor the symbol, keyword and identifier blacklist checking into
the low level token parsers instead of a separate step using guard
2015-08-01 13:22:07 +03:00
Jake Wheat
913fce068b
small fixes
...
work on the haddock
remove the old attoparsec position stuff from the lexer
change the lexer to accept position info in the same way as the parser
replace sqlindent with new test exe which can parse, lex and indent
2015-08-01 12:13:53 +03:00
Jake Wheat
2df76e3095
add separate lexer
2015-08-01 00:04:18 +03:00
Jake Wheat
2e6f2fc3f2
update changelog
2015-03-14 16:15:37 +02:00
Jake Wheat
db00d50d92
Merge branch 'master' of https://github.com/hanjoosten/simple-sql-parser into hanjoosten-master
2015-03-14 15:39:54 +02:00
Han Joosten
dc5ca57124
Introduced QEComment, constructor, likewise the VEComment constructor
2015-03-14 14:28:05 +01:00
Jake Wheat
933964e074
Merge branch 'master' of https://github.com/hanjoosten/simple-sql-parser into hanjoosten-master
2015-03-14 14:06:47 +02:00
Han Joosten
258eff5298
Introduction of Comment in syntax, to facilitate comments in programatically generated SQL
2015-03-14 12:40:35 +01:00
Jake Wheat
3bf4fdbe52
notes
2014-09-13 10:45:45 +03:00
Jake Wheat
ba331af24b
move limit to only be reserved word in mysql dialect
2014-06-28 15:43:30 +03:00
Jake Wheat
c1c514af35
example how to switch parsing and pretty printing depending on dialect
2014-06-28 15:41:11 +03:00
Jake Wheat
7d63c8f8e5
start on dialect prototype code
2014-06-27 12:19:15 +03:00
Jake Wheat
7914898cc8
update to accept latest mtl
2014-06-20 12:27:23 +03:00
Jake Wheat
8996230093
make the typename and app parsers a bit more regular
2014-05-12 22:06:29 +03:00
Jake Wheat
6c9a291930
refactor the filter parsing
2014-05-10 10:02:16 +03:00
Jake Wheat
7f90318647
refactor the app/agg/window parsing
2014-05-09 23:26:18 +03:00
Jake Wheat
4704ccc28e
create separate module for generic parser combinator utility functions
...
create separate module for the error formatting wrapper
heavily refactor the typename parser to remove almost all trys,
convert to applicative only, and left factor nicely
other refactoring to use more idiomatic parsing and to convert to
applicative only
2014-05-09 21:37:09 +03:00
Jake Wheat
9ee2a1beab
start reworking some of the combinators
2014-05-07 21:53:24 +03:00
Jake Wheat
dbd48baaa1
rename LobTypeName to PrecLengthTypeName
...
rename LobMultiplier and LobUnits to PrecMultiplier and PrecUnits
remove support for limit syntax
remove the unreserved keyword list since it isn't useful
tests for row value constructors
tests for table value constructors
tests for query specifications
tests for explicit table
work on tests for setops,order by,offset,fetch and sort specification
2014-04-20 23:14:55 +03:00
Jake Wheat
be79448414
update the reserved keywords to 2011 list
2014-04-20 19:38:43 +03:00
Jake Wheat
9b2ba2fb36
remove ref typename for consistency
...
support t and p multipliers in lob lengths
update a few tests
2014-04-20 19:24:03 +03:00
Jake Wheat
7a7f4ba7aa
work around for haddock refusal to parse literal comment lines with *
...
in first character position
get rid of code_units since these are not in sql2011
implement next value for
parse the nullary functions with reserved names
updates to the sql2003 file
2014-04-19 21:17:19 +03:00
Jake Wheat
7057241974
add filter and within group aggregates
2014-04-19 18:01:49 +03:00
Jake Wheat
59826ecce2
more docs in Parser.lhs
2014-04-19 15:10:45 +03:00
Jake Wheat
ddfac442ab
rename some functions in parser
2014-04-19 13:22:11 +03:00
Jake Wheat
445c10a01d
rearrange part of the parser file
2014-04-19 13:10:46 +03:00
Jake Wheat
fdb90c0440
change collate and in chartype to be a list of names
...
rearrange and add notes to the parser
2014-04-19 12:47:25 +03:00
Jake Wheat
fea6e347bd
change joins so natural is represented by separate field to on/using
...
some fixes and tweaks to the reserved keyword handling, especially in
the typename parser
2014-04-19 11:18:29 +03:00
Jake Wheat
5d9a32a91d
reserve most of the reserved keywords in the parser
2014-04-19 00:18:15 +03:00