AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.01k stars 653 forks source link

Using ? with limit causes "Expecting 'NUMBER', got 'QUESTION'" error #1381

Open jide opened 3 years ago

jide commented 3 years ago

When using ? with limit, it throws a syntax error. Is this intended ?

To reproduce :

alasql("SELECT `id`, `key` FROM ? WHERE `key` = ? ORDER BY `id` ASC LIMIT ? OFFSET ?",  [[ { id: 1, key: 'test' }, { id: 2, key: 'test2' } ], 'test', 1, 0]);
mathiasrw commented 2 years ago

Hmm. Does the query work if you replace the limit ? with limit 1 ?

jide commented 2 years ago

Yes it works without wildcard.

Harsh22222 commented 1 year ago

Hey Can I work on this?

yaroslav-ko commented 1 month ago

@Harsh22222 no luck?