-
Notifications
You must be signed in to change notification settings - Fork 665
Api
agershun edited this page Nov 23, 2014
·
8 revisions
alasql is a main object and function of Alasql library. It can be used in some different ways:
<script src="alasql.js"></script>
<script>
alasql('create table capitals (country string, city string, population int)');
alasql('insert into capitals values ("USA", "Washington, D.C.", 646449)');
alasql('insert into capitals values ("France", "Paris", 2211000)');
alasql('insert into capitals values ("Russia", "Moscow", 11500000)');
alasql('insert into capitals values ("Mexica", "Mexico City", 8851000)');
alasql.log('select city,population from capitals order by population desc');
</string>
- Execute SQL statement or set of statements:
alasql(sql-statement)
- Class for a number functions:
- alasql.exec(sql, params, callback) - execute SQL statement
- alasql.value(sql, params, callback) - execute SQL statement but return only one value
- alasql.log(sql, params) - execute SQL statement and log the results to console or into HTML tag
- Class for options:
- alasql.options.logtarget - target for alasql.log() functions. Values can be "console" or HTML tag
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo