Questions tagged [alasql]

Alasql - is a SQL database and data manipulation library, written in pure JavaScript and designed to work in browsers and Node.js. It provides a SQL language interface and data processing functions to data arrays. The library also provides import/export functions for CSV, TAB, JSON and other data file formats. It can use LocalStorage and IndexedDB as backend storage.

Alasql - 'à la SQL' - is a lightweight JavaScript SQL database designed to work in browser, Node.js, and Apache Cordova. It supports traditional SQL with some NoSQL functionality. Current version of Alasql can work in memory and use file, IndexedDB, and localStorage as a persistent storage.

See also

Useful links

225 questions
5
votes
1 answer

Alasql -Multiple sheetids within single promise statement

I am trying to call multiple sheets from the excel file ,by implementing single promise statement but it always outputs the data of first sheet. Thank you. alasql.promise('select * from xls("raw/food.xls",[{sheetid:"Data"},…
rahul.sharma
  • 457
  • 6
  • 20
5
votes
0 answers

can i use ALASQL for CORDOVA?

I want to develop an offline application in which the data has to be retrieved from a dump ( .csv or,.xslx ) .. 1.Can i use alasql framework in my cordova application ? 2.if yes, What is the procedure... Will this application work on Android and…
Mr.Robot
  • 489
  • 2
  • 8
  • 17
4
votes
4 answers

Does Javascript run lines of code in order? and finish processing then move on?

I am trying to write some code in Javascript for first time, and I am guessing I dont get something conceptually! The following code for me works fine : var db = new alasql.Database("db"); db.exec('CREATE TABLE IF NOT EXISTS Myonetwo;'); var aaa =…
Roozbeh G
  • 427
  • 4
  • 18
4
votes
1 answer

Define cell format on AlaSQL/JS-XLSX Excel Export

Is it possible to define cell format on AlaSQL export to Excel? I'm maintaining a system that exports grid data to Excel using AlaSQL. The problem is that Excel data is not being converted to NUMBER. DATE values do OK, but Numeric types are always…
Victor Magno
  • 91
  • 2
  • 6
4
votes
1 answer

Reuse variable from alasql

I am newest in JS and I can not reuse variable from alasql. when I run my code i have "unidifined" var dataSource = alasql('SELECT AGENT_NAME, count(*) FROM XLSX("export.xlsx",{headers:true}) GROUP BY AGENT_NAME') console.log(dataSource) but…
4
votes
2 answers

How to set custom header names with ALASQL and XLSX

I'm exporting some tables to excel, using angular, alasql and xlsx. I'm using it as follows: var options = { headers: true, sheetid: 'users', columns: [{ columnid: 'a', title: 'Username' }, { columnid: 'b', …
Luis Crespo
  • 1,610
  • 1
  • 20
  • 33
4
votes
0 answers

Export to csv not working on Safari with Alasql JavaScript library with XLSX.js. - Angularjs

I want to export table data in csv format in my app. I have used Alasql library with XLSX.js. It works fine with all modern browsers(Chrome, Firefox ..) not on Safari.
user4827334
4
votes
1 answer

SQLite with JavaScript

I'm working on a small project where I'm going to read some parameters from a SQLite database. The data is generated from a Linux server running a C code. I then want to create a script using JavaScript to fetch the data from the database. I've…
user2263752
  • 469
  • 1
  • 6
  • 8
3
votes
0 answers

alasql select from object rather than array

For good reasons not worth explaining, I would like to use alasql to pull a numeric value from a nested json object. According to the docs it seems like this should work: const data = {a:{b:42}}; const answer = alasql('select a->b from…
Category6
  • 516
  • 5
  • 19
3
votes
2 answers

How to summarize an array with group and rollup from d3-array?

I'm trying to use d3-array to generate two summaries of an array of objects: What actions did each teacher perform? What posts did each teacher edit? This is my current approach: const data = [ { post_id: 47469, action: "reply",…
nachocab
  • 13,328
  • 21
  • 91
  • 149
3
votes
3 answers

Loop through list of maps to filter map key-values using JS

How to loop through list of maps to filter out SearchMap key-values from below List having map of records using JS? Map var searchMap = new Map() searchMap.set("ed_mood", "strong") searchMap.set("ed_target_audience",…
user2423706
  • 159
  • 4
  • 15
3
votes
0 answers

Angular 5 with Cli alasql can't find xlsx.js

xlsx from JSON with alasql and xlsx. I was able to generate a xls with alasql, but the xlsx generation fails. I added the script to the cli and the compiler has no errors. When I call the function genXlsx(), which does the rendering, I get a…
3
votes
1 answer

alasql requires xlsx which is already included

I am trying to export data to an excel sheet using alasql and xlsx. I have followed all the guidelines here: https://github.com/agershun/alasql/wiki/Xlsx This is my function: exportToExcel(data: any) { console.log(XLSX.version); alasql …
Nikola
  • 2,093
  • 3
  • 22
  • 43
3
votes
0 answers

how to check lottery wining numbers javascript

Objective I wish to query a excel spread sheet to check the numbers entered in the html form are winning numbers. Winning numbers winning numbers would be if the first, second, third, fourth fifth, and sixth number entered in the HTML matches the…
Beep
  • 2,737
  • 7
  • 36
  • 85
3
votes
0 answers

How to query in a nested JSON object with alaSQL

I have a JSON object like this (showing just one element, I got hundreds and each element belongs to many different regions): let obj = [{ "id": 1 "name": "Name", "month": 1, "year": 2017, "regions": [ {"id": 1,…
J0sh
  • 51
  • 1
  • 3
1
2 3
14 15