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
2
votes
1 answer

How do you create a time field in AlaSQL

I am trying to make a simple app to analyze how I spend my time. To do this I want to make a SQL database using AlaSQL with the following schema: id - some unique value date - a date field start_time - a time field end_time - a time field task - a…
GeneBean
  • 361
  • 4
  • 17
2
votes
1 answer

Conditional summing (Alasql)

I've recently discovered Alasql, which is already saving me tons of work with data manipulation. Now I'm trying to aggregate yearly revenues for each customer. I've tried partition by with no success, and I've tried this conditional approach, but it…
Cos
  • 1,649
  • 1
  • 27
  • 50
1
vote
0 answers

How to update a table with data from another table in Alasql

I'm using alasql and I am trying to update a table with data from another table, but without success. Let's say I have a tableA as the one underneath id Age 1 25 2 31 And a tableB like this id newAge 1 26 2 32 I tried the…
1
vote
0 answers

Filter sub arrays in AlaSQL

I have a Javascript object being passed into AlaSQL like: const details = { "returnCode": 0, "someProperty": { "results": [ { "resultId": 1234, "resultProperty1": "asdf", "notWantedProperty": "notThis", …
Slyke
  • 124
  • 1
  • 12
1
vote
0 answers

Having trouble using variable inside SQL, when using alasql

It may be a beginner question, but I don't know how to use a variable inside a SQL query. const CCqry = req.params.CC; // It contains a string var values =Object.values(DATA.laureates); const result = alasql("SELECT * FROM ? WHERE bornCountryCode =…
Vishwa.R
  • 11
  • 1
1
vote
0 answers

How to export json data to excel as a date using alasql?

I'm using alasql to export a data to excel using angular 8 and alasql 0.6.2. It is working perfectly fine. Code snippet below - const opts = [{ sheetid: 'Sheet 1', header: true }, { sheetid: 'Sheet 2', header: false }]; const fileName =…
khabbab nazar
  • 21
  • 1
  • 5
1
vote
0 answers

How to run SQL Query on webpage with Sheetjs?

I'm making a project for my internship. And I need to run SQL query with input .xlsx file like sheetjs demo(https://sheetjs.com/sexql/index.html) and i have no idea how to do it. I tried so many things but none of them worked. …
1
vote
0 answers

Inserting images to Excel with pure JavaScript

I'm currently exporting data to an xls file with alasql library, but I need to insert images to the same file. I converted my image to base64 and added it to the JSON but shows pic related when exported: I discarded the SheetJS library because…
1
vote
1 answer

How to add title row and cell formatting when exporting data to excel using alasql in angular js application?

In my angular application I want to export the data to an excel file, I have used alasql for the same. How do I add the title which should be a row with cell merged and also show the filter parameters on which the data is generated in the excel…
1
vote
1 answer

How to make knex use alasql as a custom dialect

I'm trying to configure knex so I can run seeder and migrations against a test database for integration tests. I chose alasql and found some resources here and here suggesting this is possible. I'm using the knex-alasql module and its setup…
WhyAyala
  • 647
  • 7
  • 29
1
vote
0 answers

alasql use numbering instead of question mark for queries

I am using Alasql to merge json objects. I have this alasql query: SELECT Employment.*, EmploymentCore.CompanyCode AS EmploymentCore_CompanyCode, Accumulator_DaysInAdvance.VacationYearValue AS Accumulator_DaysInAdvance_Value, …
kimondoe
  • 567
  • 2
  • 9
  • 27
1
vote
1 answer

AlaSQL User Defined Functions with Parameters

I am new to AlaSQL: alasql('CREATE TABLE cnames(domain STRING, cname STRING)'); alasql('CREATE TABLE domains(domain STRING, ip_addr STRING)'); alasql('INSERT INTO domains VALUES ("fred.com.au","192.168.0.1")'); alasql('INSERT INTO cnames VALUES…
tonyf
  • 34,479
  • 49
  • 157
  • 246
1
vote
0 answers

How to init an alasql database?

I try to use alaSQL, but not working well for me. My scenario is create a localstorage db when is not exists. In this case i "init" the database. It means i create all tables and insert some records. Finally i select some data and send to the…
Joe
  • 11
  • 2
1
vote
0 answers

Wrong usage of FILE - alasql angular2

I am trying to import CSV and get the result in an array. I am following this jsfiddle print('AlaSQL v'+alasql.version) print('Please upload txt, json, csv, tsv, tab, xlsx, xls or html file to see the content') loadFile = function(event) { …
1
vote
0 answers

Unable to sum up column values and display in end of row in excel using alasql

I have json array value that has to be displayed in various sheets in excel,so I have use the json format as below var opts=[ { "sheetid": "Ali", "header": false }, { "sheetid": "Ari", "header": false }] var exportArray=[ [ { "driver": "Ari", …
Janaki Narayanan
  • 523
  • 6
  • 24