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.03k stars 656 forks source link

Fix multiline text parser problem #257

Open agershun opened 9 years ago

agershun commented 9 years ago
var res = alasql(function(){/*
     CREATE TABLE one (
                t TEXT
     );
     INSERT INTO one VALUES ('My  
     huge * * * * * * * * * * * * * ************* ****** ****** text');
    SELECT * FROM one;
*/});

See this example.

It does not work, because AlaSQL parser does not recognize multi-line string inside SQL text.

mathiasrw commented 9 years ago

I dont get this.

The SQL is in a comment so it corresponds to

var res = alasql(function(){});

so no output...

agershun commented 9 years ago

Yes, there is no output because there is a line break inside the text string. Try to remove it, and all will work. Plus, AlaSQL does not support backslashed characters like "\t"

Отправлено с iPhone

29 мая 2015 г., в 8:30, Mathias Rangel Wulff notifications@github.com написал(а):

I dont get this.

The SQL is in a comment so it corresponds to

var res = alasql(function(){}); so no output...

— Reply to this email directly or view it on GitHub.

mathiasrw commented 9 years ago

OK ok - I get it. Was not aware of this notation...