CityOfPhiladelphia / soda-carto

Query Carto datasets with a Socrata-style SODA2 API
6 stars 2 forks source link

?limit=10 throws error #25

Open timwis opened 7 years ago

timwis commented 7 years ago

I queried ?limit=10 by accident (it should be ?$limit=10 and noticed it threw a lambda/api gateway error. In theory, it should generate WHERE limit = 10, which should just throw a sql error. Indicates something failed and the error's being lost.

timwis commented 7 years ago

Looks like the error is being thrown in the peg grammar, pretty deep down the stack.

/Users/tim/Sites/soda-carto/node_modules/node-sqlparser/lib/parse.js:8084
      throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);
      ^
SyntaxError: Expected "(" or WHITE_SPACE but "=" found.

We might need to call this one "wontfix"...

andrewbt commented 7 years ago

The problem can't be as simple as, there's a query string variable defined for $limit but not limit? Is it deeper than that?

Also, limit doesn't seem like valid SODA, so I agree with your assessment of 'wontfix' if needed... this would be like a "typo convenience feature", no?

timwis commented 7 years ago

hah, yeah, let's call it that :P

The reverse proxy puts anything that doesn't have a leading dollar sign as part of the where clause. It's probably because the where clause fields aren't wrapped in quotes or something, so the parser assumes it's the limit.