tastott / jsoql

A SQL-like language for querying JSON data
http://tastott.github.io/jsoql
3 stars 1 forks source link

Escape keywords, spaces, etc. in property names and aliases #59

Closed tastott closed 9 years ago

tastott commented 9 years ago

E.g. to SELECT a property called FROM:

SELECT [FROM] FROM '...'
tastott commented 9 years ago

Will probably have to be something other than square brackets as they are used for arrays.

tastott commented 9 years ago

A Javascript-y way of doing this would be to use the square bracket property accessor thing with an alias

SELECT person["First Name"]
FROM 'file://people.json' AS person

Column aliases themselves could just go in double quotes:

SELECT person["First Name"] AS "Something else"
FROM 'file://people.json' AS person