Open nbk2000 opened 2 years ago
@nbk2000 could you try wrapping it in back ticks?
SELECT * FROM `example.com.json`
That results in the same error
@nbk2000 can't reproduce, I've just tried
octosql "SELECT * FROM `books.test.json`"
and it works perfectly well.
Is it possible that a different part of your query is resulting in that error?
I don't think so, since changing the filename results in correct behavior, and the error message is quite explicit as to the position of the offending character. For example:
octosql "SELECT * FROM `example.com.json`"
results in the error:
Error: couldn't parse query: invalid argument syntax error at position 15
While removing the backticks like this:
octosql "SELECT * FROM example.com.json"
results in the error:
Error: couldn't parse query: invalid argument syntax error at position 27
This is on Ubuntu AMD64, in case that makes any difference.
Out of curiosity, What happens on your system when you don't include the back ticks?
Ok, this actually seems to be caused by bash. I've been running on the fish shell, but on bash I get the same error as you and the first line of the output is
bash: example.com.json: command not found
so it seems like bash is treating the backticked part like a command it should execute and use the output of.
Escaping it seems to work correctly:
octosql "SELECT * FROM \`example.com.json\`"
Yep backticks cause execution in bash. My results are the same as yours, so this is a workable workaround.
Can I make a feature request that multi dot files be supported without resorting to escaped backticks? (seems like an unnecessary footgun)
Sure, agreed, I'll look into it when I have some time. Until then, I'll change the title of this issue to track this.
Hi there,
Escaping it seems to work correctly. Yep backticks cause execution in bash. My results are the same as yours, so this is a workable workaround.
I was struggling on the same thing and wanted to add that using single quotes is another option.
octosql 'SELECT * FROM `foo-bar.csv`;'
With kind regards, Andreas.
P.S.: By the way, thanks so much for conceiving octosql
, @cube2222.
Using octosql version 0.9.4 and running the following command:
octosql "SELECT * FROM example.com.json"
Results in the following error:
Error: couldn't parse query: invalid argument syntax error at position 27
If the filename is changed to
example_com.json
then no error occurs and the program functions normally