flowlight0 / simpledb-rs

MIT License
0 stars 0 forks source link

Accept lowercase characters in SQL keywords. #22

Open flowlight0 opened 5 days ago

flowlight0 commented 5 days ago

The current client doesn't allow queries like "select A, B from table" because it requires "SELECT" instead of "select". The client should accept SQL keywords with lowercase characters.

flowlight0 commented 4 days ago

https://lalrpop.github.io/lalrpop/lexer_tutorial/001_lexer_gen.html#renaming-match-declarations mentions about how case insensitive keywords can be implemented.

However, this usage of match doesn't solve the problem because it replaces words like "select" regardless of its context. I don't want "select" in string values to be replaced with "SELECT".

It looks that a custom lexer (https://lalrpop.github.io/lalrpop/lexer_tutorial/003_writing_custom_lexer.html) is required if I want to solve this issue in a correct way.