Nickolay Ponomarev
f21cd697c3
Simplify custom datatypes handling and add a test
...
1) Simplified the bit in parse_datatype()
2) Made sure it was covered by the test (the "public.year" bit)
2a) ...the rest of changes in the test are to fix incorrect variable
names: c_name/c_lat/c_lng were copy-pasted from a previous test.
3) Removed the branch from parse_pg_cast, which duplicated what
parse_data_type already handled (added in the same commit even
2007995938
)
2019-01-11 02:37:36 +03:00
Nickolay Ponomarev
7c6e6970fa
Simplify the {next|prev|peek}_token functions
...
Remove `pub` from the "internal" ones. Remove ones that duplicate each
other completely.
2019-01-11 02:37:36 +03:00
Nickolay Ponomarev
2873b0cee2
Combine multiple patterns with the same action in parse_prefix()
2019-01-11 01:49:13 +03:00
Andy Grove
e863bc041c
cargo fmt, fix compiler warnings
2018-12-16 13:57:01 -07:00
Clemens Winter
91aa985ed0
Add LIKE operator
2018-12-16 11:26:09 -08:00
virattara
b75a22ce2e
consume semi colon at the end of select and delete queries
2018-10-17 15:52:11 +05:30
Andy Grove
70a3ae93c8
Merge pull request #25 from nickolay/master
...
Support "searched" CASE expressions
2018-10-16 20:03:34 -06:00
Andy Grove
7e152cd0a9
revert one timestamp parsing case
2018-10-14 12:26:47 -06:00
Andy Grove
1bb7149670
bug fix
2018-10-14 12:12:23 -06:00
Nickolay Ponomarev
5a396bb9b4
Support "searched" CASE expressions ( #15 )
...
https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#searched-case
2018-10-14 20:45:32 +03:00
Andy Grove
633aeb9162
Merge pull request #26 from virattara/fix_order_limit
...
fix for queries with both order by and limit
2018-10-14 10:13:22 -06:00
virattara
9f47e8ac94
fix for queries with both order by and limit
2018-10-12 16:10:00 +05:30
virattara
94df7c22e6
added support for expressions with parentheses
2018-10-07 14:23:05 +05:30
Andy Grove
661ada0664
fix compiler warnings
2018-10-06 09:58:16 -06:00
Andy Grove
722ea7a91b
ran cargo fmt
2018-10-06 09:39:26 -06:00
Andy Grove
9daba3ab49
move tests to tests dir
2018-10-06 09:39:06 -06:00
Jovansonlee Cesar
ba8a9bd48f
NULL need to be detected in COPY
2018-09-30 04:19:15 +08:00
Jovansonlee Cesar
5abd9e7dec
Modularized into separate files
...
Add ToString implementation on the components
2018-09-30 03:34:37 +08:00
Jovansonlee Cesar
34913c7051
Implement alter table constraint operation
2018-09-29 19:37:03 +08:00
Jovansonlee Cesar
639f01d4e7
Make Uuid a datatype in PostgreSQL dialect
2018-09-29 13:50:33 +08:00
Jovansonlee Cesar
da153bf848
Make a PostgreSQLDialect
...
Add is_primary and is_unique in the column definition
Initial code for testing alter table
2018-09-28 03:32:10 +08:00
Jovansonlee Cesar
74b34faaf1
Also tokenize non alphanumeric characters into some Char, since they can be tab separated values in COPY payload
2018-09-26 23:59:52 +08:00
Jovansonlee Cesar
7c7b67b0bc
testing values for most common data dump
2018-09-26 22:51:50 +08:00
Jovansonlee Cesar
34412f7e3d
Whitespace tokens are not skipped
...
Differentiate single quoted string and double quoted string
2018-09-26 22:46:16 +08:00
Jovansonlee Cesar
8dbb62cddd
unify parsing of sql_values
2018-09-26 15:41:57 +08:00
Jovansonlee Cesar
6aca4de658
Remove unused functions
2018-09-26 15:11:49 +08:00
Jovansonlee Cesar
096b2bf7ba
Parsing timestamp and datetime alongside
2018-09-26 14:56:46 +08:00
Jovansonlee Cesar
7803063ece
Add parsing of timestamp values
2018-09-25 22:33:01 +08:00
Jovansonlee Cesar
9ab5c1358d
Modularize SQLValue into an enum
...
Add capability of parsing dates
2018-09-25 15:54:29 +08:00
Jovansonlee Cesar
199ec67da7
Add implementation for parsing SQL COPY
2018-09-25 01:31:54 +08:00
Jovansonlee Cesar
719df789e4
Merging parse_inser and improve-create-table branch into these
2018-09-24 19:14:26 +08:00
Jovansonlee Cesar
78c054ea19
Add Boolean value data type
...
remove unecessary consume of LParen and RParen in default value
2018-09-24 05:53:58 +08:00
Jovansonlee Cesar
2007995938
Improve the create statement parser that uses create statements from pg database dump
...
Added PostgreSQL style casting
2018-09-24 03:34:40 +08:00
Jovansonlee Cesar
46274c536b
Remove println debugging
2018-09-21 15:37:28 +08:00
Jovansonlee Cesar
5adce6a013
Implement parsing insert statement
2018-09-21 15:19:59 +08:00
Jovansonlee Cesar
7d27abdfb4
Correction on prev_token, the index should decremented
2018-09-21 02:34:44 +08:00
Andy Grove
810cd8e6cf
tokenizer delegates to dialect now
2018-09-08 14:49:25 -06:00
Andy Grove
06a8870bd7
Introduce concept of dialects
2018-09-08 08:39:32 -06:00
Andy Grove
cc725791de
cargo fmt
2018-09-08 08:10:05 -06:00
Andy Grove
d58e59324b
Add SQLOrderBy struct to replace ASTNode::OrderByExpr
2018-09-08 08:09:32 -06:00
crw5996
549ed6e83a
Implemented DELETE keyword. Not much to do, all of the subexpressions were already handled
2018-09-06 16:00:46 -04:00
Andy Grove
cfe7ee5613
make precision on FLOAT optional for now
2018-09-03 14:56:26 -06:00
Andy Grove
a10482c353
cargo fmt
2018-09-03 13:51:52 -06:00
Andy Grove
80cb9b13ce
Remove FileType, fix compiler warning
2018-09-03 13:51:43 -06:00
Andy Grove
7bea9a8648
cargo fmt
2018-09-03 11:45:03 -06:00
Andy Grove
5bac9fd131
Remove some non ANSI SQL support
2018-09-03 10:25:05 -06:00
Andy Grove
0c23392adb
replace with code from datafusion
2018-09-03 09:56:39 -06:00