cube2222 / octosql

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Mozilla Public License 2.0
4.74k stars 201 forks source link

queries using filenames that start with non-alpha characters fail #309

Closed protectroot-com closed 1 year ago

protectroot-com commented 1 year ago

$ sha256sum a.json
4518d5db3dedeaf5b8cf078d8090b5d3d8b2da6befe9cddbf0544d4f3e61cb45 a.json

$ sha256sum 1.json
4518d5db3dedeaf5b8cf078d8090b5d3d8b2da6befe9cddbf0544d4f3e61cb45 1.json

$ ~/go/bin/octosql "select 'works' from a.json limit 1" +---------+ | col_0 | +---------+ | 'works' | +---------+

$ ~/go/bin/octosql "select 'sad face' from 1.json limit 1" Usage: octosql [flags] octosql [command]

Examples: octosql "SELECT FROM myfile.json" octosql "SELECT FROM mydir/myfile.csv" octosql "SELECT * FROM plugins.plugins"

protectroot-com commented 1 year ago

Seeing the same issue with filename a.b.json

$ ~/go/bin/octosql "select 'sad face' from a.b.json limit 1" Usage: octosql [flags] octosql [command]

Examples: octosql "SELECT FROM myfile.json" octosql "SELECT FROM mydir/myfile.csv" octosql "SELECT * FROM plugins.plugins"

protectroot-com commented 1 year ago

strangely my go to consolidated file name, all.json doesn't work either.

cube2222 commented 1 year ago

Hey @protectroot-com!

You can use double quotes for names which aren't accepted as-is.

So \"1.json\" in your case.

cube2222 commented 1 year ago

Closing for now. Feel free to reopen.