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
1
vote
1 answer

how to put particular date in where clause in alasql

See the below data on which i am doing query. result = alasql("SELECT HourOfDay, Count(HourOfDay) TotalCount from ? where ReportedDate = DATE('1/20/2012') group by HourOfDay ", [data]) …
Mahi Kalyankar
  • 257
  • 5
  • 18
1
vote
1 answer

Alasql - querying nested objects in json

I have a json object like below. Ebay Object { __v: 0 _id: "56e192f0aea7131c15513328" headquarters: "New York" name: "Ebay" productCategories: [{ _id: "56e193beaea7131c1551332d" name: "Footwear" …
sabari
  • 2,595
  • 5
  • 28
  • 44
1
vote
1 answer

Alasql Best Practices

I'm new to alasql (which is amazing). While the documentation shows you how, it doesn't provide a lot information on best practices. To date I have simply been running queries against an array of arrays (of js objects). i haven't created a database…
Mark Salamon
  • 569
  • 1
  • 8
  • 21
1
vote
1 answer

How to use alasql in angular js controller?

I am using alasql in my angular js web app. I have included script(type='text/javascript',src='http://cdn.jsdelivr.net/alasql/0.2/alasql.min.js') in my jade. In my client side, in my module.js, I have included angular.module('alasql.core',…
sabari
  • 2,595
  • 5
  • 28
  • 44
1
vote
0 answers

Save Alasql instance to file

Is it possible to serialize/save to filesystem an instance of alasql db? Currently,docs says it can read but not write to sqlite file.
John Vincent
  • 23
  • 1
  • 4
1
vote
1 answer

Reading an excel file using cordova in ios

I am currently working on a hybrid app for iOS. I am using Ionic/Cordova to make it. It's my first time using it. I want to be able to read an xlsx file that is currently on my iPad and show that data in my app in a table format. I have read about…
cavallaro
  • 41
  • 2
  • 5
1
vote
0 answers

Alasql - Having columns with sub-columns

https://i.stack.imgur.com/OfaPs.png I am attempting to do nested columns similar to the image I have linked above, as I have multiple columns that are grouped to a single header but I'm not sure how to do this. I was assuming I could do something…
asoper29
  • 11
  • 1
1
vote
0 answers

Add cell alasql

How I can add a cell above the headboard ? Thank you, great job enter image description here My intention is to put multiple cells above the table using materials alasql
sourcer
  • 67
  • 1
  • 9
1
vote
1 answer

export multiple json objects to xlsx file using alasql

first time using alasql, and sql in general, however trying to export multiple json objects to xlsx file i am using alasql('SELECT * INTO XLSX("Report.xlsx",{headers:true}) FROM ?', [$scope.children, $scope.answer, $scope.optional,…
Kero
  • 1,924
  • 5
  • 33
  • 53
1
vote
2 answers

Query JavaScript Object group by

I have a JavaScript object like this: [{"a":1,"b":2},{"a":1,"b":3},{"a":2,"b":4},{"a":2,"b":5}] I want to group this object field 'a' and want something like…
sau
  • 1,316
  • 4
  • 16
  • 37
1
vote
1 answer

Node.JS: export data from mysql to excel using alasql

I'm writing a script to export data from mysql to excel using Node.JS and alasql. I can see examples in doing this. var mystyle = { headers:true, column: {style:{Font:{Bold:"1"}}}, rows: {1:{style:{Font:{Color:"#FF0077"}}}}, cells: {1:{1:{ …
Lee
  • 2,874
  • 3
  • 27
  • 51
1
vote
1 answer

AlaSQL: Getting where opperands

I have a specific request that I'm rather sure it's not trivial, but thought of asking just in case. If I have any query with WHERE condition: SELECT * FROM table1 WHERE a = b AND a->fn(b->c) > 0 I would like to know all the operands that take part…
Filip Kis
  • 1,650
  • 2
  • 14
  • 18
1
vote
1 answer

ALASQL: How to reference the JSON object it self (to call a function on it)?

I have the following object and I would like to call it's function. [{a:1, fn:function(){} }] Now I know if the object would be nested ([{a:1, b:{fn:function(){} } }]) that I could do b->fn() but how do I do it when it's direct property of the…
Filip Kis
  • 1,650
  • 2
  • 14
  • 18
1
vote
1 answer

Complex object data structure to xlsx

I have a javascript object that contains in itself other objects: { "10": {}, "12": { "20": { "value": 1, "id": 1, }, "100": { "value": 12, "id": 1, } }, …
dearn44
  • 3,198
  • 4
  • 30
  • 63
1
vote
1 answer

getting all array property data using alasql

I have here a JSON object having an array of data. My issue is how could I get the array data to export it to excel? I'm currently using alaSql for this. { a: 'test', b: [ {c:'test1', d: 'test2'}, {c:'test2', d: 'test1'}] }
Michael
  • 187
  • 1
  • 13
ReportedDate