Closed the42 closed 3 years ago
Hi @the42,
The problem is that JavaScript doesn't have and
keyword - you need to use &&
And there is actually another problem with RBQL itself or more precisely with the V8 engine: it currently doesn't correctly report what goes wrong inside eval expressions: https://bugs.chromium.org/p/v8/issues/detail?id=2589 - Right now it just says "Unexpected identifier" without pointing to the and
keyword, so it also took me some time to figure out what is wrong with your query.
So it's purely a documentation issue: https://github.com/mechatroner/rainbow_csv/blame/master/README.md#L397
Your suggestion works perfectly now and I am aware that the whole WHERE-clause is treated as a Javascript expression (or Python)
Thanks! I just fixed the docs, sorry about that!
Actually, I think this mistake can be very common, so a special handler can be added which makes the error more clear. I.e. in case of the "Unexpected identifier" exception in JavaScript check if the query contains and
or or
and if it does - Show something like For JavaScript use && and || instead of "and" and "or"
I improved the error message!
BTW there is no need to install rbql with npm install -g rbql
- the node version of rbql is already built-in into the plugin.
Using Rainbow_CSV on Neovim nightly on Windows 10.
Scripting engine is node, installed with
npm install -g rbql
and setlet g:rbql_backend_language = 'js'
in init.vimThe following statement
should filter rows in the CSV-file, where column 19 contains non-integer numbers.
It results in the following error message: