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
0 answers

AlaSQL update Javascript object Where certain conditions are met

I'm trying to learn how to use AlaSQL and want to perform an update command on an array of objects, this is what I was trying to do: alasql('UPDATE ? SET cc_fee=? WHERE id=?', [$scope.payments, response.cc_fee, response.id]); That returns a parsing…
Jordash
  • 2,926
  • 8
  • 38
  • 77
2
votes
1 answer

AlaSQL.js WHERE Clause on a Feld that is an Array of Objects

What I'm trying to do is SELECT metadata->name, metadata->namespace but only if the spec.volumes contains an object with secretName = 'test-secret' from a list of objects that look like this: { "kind": "PodList", "apiVersion": "v1", …
pnovotnak
  • 4,341
  • 2
  • 27
  • 38
2
votes
1 answer

Alasql is undefined

I can't seem to get the Alasql to become defined, i have installed it via node and I'm fairly certain that it is installed proplery however whenever i load my front end. i'm not 100% sure where it's going wrong, any help would be greatly…
GingerFish
  • 457
  • 3
  • 11
  • 26
2
votes
1 answer

D3.js change time format and export data into csv

Have an original CSV(cities_9_2.csv) file like this: date "Wed, 01 Jul 2015 15:16:45 GMT" "Wed, 01 Jul 2015 15:22:13 GMT" "Wed, 01 Jul 2015 15:28:52 GMT" "Wed, 01 Jul 2015 19:56:27 GMT" Want to change the time format to 5/16/2016 12:00:00AM, have…
user2592038
  • 377
  • 1
  • 6
  • 19
2
votes
2 answers

Alasql select in arrary of array with uknown index

suppose I have this structure data data =[ { "id":1, "link":[ { "id":3 }, { "id":1 }, { "id":2 } ] }, { "id":2, "link":[ { "id":30 }, …
2
votes
2 answers

get data from array of object in between date range in alasql

I am using alasql to get data between given date range from array of object in JavaScript. i tried below query but i am not getting any result. i am passing start date and end date and i want the data between those range only, if there is any other…
Mahi Kalyankar
  • 257
  • 5
  • 18
2
votes
1 answer

Formatting the export Excel with ALASQL (AngularJS)

Firstly a big compliment on the contributors of the alasql-project. It helps me a lot to export my JSON data to excel file. But for the next steps, I need some help about formatting the excel file. Is it possible to define the cells with an…
yuro
  • 2,189
  • 6
  • 40
  • 76
2
votes
0 answers

Alasql -- inserting into array only if it doesn't exist

Using alasql, I'm trying to insert a value into an array that is a value of a property only if it doesn't already exist. It's set up like this: [{"name": "Bob", "assocIDs": [1, 5, 10]}, {...}] I'd like to be able to insert 6 into assocIDs only if…
linus72982
  • 1,418
  • 2
  • 16
  • 31
2
votes
1 answer

Alasql: UNION (or UNION ALL) only gives results from table1

When using UNION or UNION ALL in a GROUP BY query using alasql (https://github.com/agershun/alasql), only results from table1 are retrieved. Running separate queries outputs correct results instead. See this jfiddle…
MDT
  • 1,599
  • 4
  • 18
  • 26
2
votes
0 answers

Loading CSV file with AlaSQL and JQuery

I'm building an HTML based app for querying imported CSV file using AlaSQL. I started with this demo and tried to implement the same behavior by setting the onChange event through JQuery rather than in the tag. I basically follow the same pattern,…
abalter
  • 9,663
  • 17
  • 90
  • 145
2
votes
1 answer

xlsx.core.min.js:13 Uncaught Error: Unsupported file NaN

I facing a error using alasql with xlsx.core.js. code is alasql('select * from xlsx("Leads.xlsx")',[],function(data) { console.log(data); }); error that comes up is.=> Uncaught Error: Unsupported file NaN how can i resolve this error. or suggest me…
Umar Farooq Aslam
  • 485
  • 1
  • 8
  • 17
2
votes
0 answers

alasql attaching to sqlite

TANACH_6_1.db exists at the same location as the following HTML. It runs (no errors) but nothing appears at the terminal. Have checked and rechecked syntax and looked at several examples. Tested sql in "SQLEXPERT". alasql is working as I was…
Martin Levine
  • 27
  • 1
  • 4
2
votes
1 answer

field name "action" cause issues alasql export to Excel

I am using alasql to export to excel and I am trying to do custom headers like this below. All other field names are fine except when it is "action" function myCtrl($scope) { $scope.exportData = function () { alasql('SELECT name as MY_NAME,…
yalkris
  • 2,596
  • 5
  • 31
  • 51
2
votes
1 answer

Set the column width of the exported Excel file

I am trying to figure out the syntax of using Alasql to specify the column width for an Excel file. I tried something like: var mystyle = { headers:true, column: {width:"300px"} }; but it didn't work. Is Alasql capable of doing this and…
chengl
  • 261
  • 3
  • 6
2
votes
1 answer

Compare Date objects in alasql

I am trying to write a select statement that includes a where clause that will only return records from the selected date. My table utilizes the Javascript object version of dates. I've tried things like this without success: select * from my…
GeneBean
  • 361
  • 4
  • 17
1 2
3
14 15