Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 676 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 676 Bytes

alasql-loader

Compiles sql from alasql and emits a JSON of the db. Currently is extremely naive (see Why?) and not nearly complete.

Usage

SOURCE "./TEST_LOAD.sql";

INSERT INTO TEST_LOAD VALUES (1,'B');

CREATE TABLE TEST_TABLE (
  X INT,
  Y TEXT
);
INSERT INTO TEST_TABLE VALUES (1,'A');
  var db = require("alasql!./TEST_TABLE.sql");
  alasql.databases.alasql = db;
  assert.deepEqual(alasql("SELECT * FROM TEST_TABLE"),[{X:1,Y:"A"}]);

License

MIT

Why?

  • Compile time checking is useful
  • To see if I can cut out the clientside parser

Limitations/TODO

  • SELECT statements don't work