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

How to give color to excel row while exporting data using alasql - angularjs sql api

I am little confused to give styling for excel rows while exporting the data using alasql. Below is the code that I am working on $scope.exportData = function () { var mystyle = { sheetid: 'Test_sheet', headers: true, …
newbie
  • 1,282
  • 3
  • 20
  • 43
0
votes
1 answer

How to make headers bold in alasql export to xlsx

I am exporting an array to xls using alasql. It seems header:true or header:false has no effect on showing or not showing the headers. In my case I want to show the headers, but I want them to be bold. This is what I am using, but it is not working.…
S.vanNerum
  • 15
  • 1
  • 7
0
votes
1 answer

Alasql result to be used in other parts of the program

I have imported an XLSX file but i cannot seem to use the result outside its function: var dataResult; alasql('select * from xlsx("adat.xlsx",{headers:true, sheetid:"adat", range:"A1:B21"})', [],function(data) { dataResult=…
elwindly
  • 45
  • 1
  • 7
0
votes
1 answer

Array to CSV add separator between every character

I'm using alasql to convert into CSV: data = ["402 Fourth Avenue", "11 Russell Avenue", "East Diamond Avenue"]; function exportData(list) { alasql.promise('SELECT * INTO CSV("test.csv", {separator:" "} ) FROM ?',list) …
dgrubman
  • 161
  • 1
  • 3
0
votes
1 answer

alasql export to xlsx remove hashkey

I am using angularjs and javascript and want to export two arrays to Excel using alasql. The Excel file has two sheets, on every sheet there is one array. In my Excel result I find an extra column $$hashkey. According to the information I found,…
S.vanNerum
  • 15
  • 1
  • 7
0
votes
1 answer

alasql CSV pulling through functions

So I have written a function to pull data from a C# controller. It is pulled through into a FormData object and then converted into an array, the array is supposed to be broken down into comma separated values. however when I download the csv this…
0
votes
0 answers

parent and child key in alasql rollup functions

I need to have the parent key on all child records when using rollup. Is there any easy way to solve this using alasql and rollup? It will be used to show/hide child rows in reports. There are multiple levels of subtotals in the report. One child…
Jorn M
  • 1
  • 2
0
votes
2 answers

Using "AS" clause in SQL statement in alasql (AngularJS)

As the title describes, I have the problem, that I'm getting an error message as soon as I try to use the AS clause in the sql statement of the angular module alasql. The following error message will displayed: Error: Parse error on line 1: ...…
yuro
  • 2,189
  • 6
  • 40
  • 76
0
votes
1 answer

Alasql and Angular; jszip is not a constructor error

So reading another article and solution here I found the library Alasql which seems to do what I need. I've installed it and was writing a proof-of-concept application to use it and when I attempt to use the illustration given in that article I…
jb-aamc
  • 1
  • 1
  • 5
0
votes
2 answers

Import Excel file to a table of HTML page

I have a simple Excel file in my computer at "D:/Book1.xls". I want to import it to make a table and append the table to a div tag in my HTML page. Would you modify my code below? Insert…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/jquery" class="post-tag grid--cell" title="show questions tagged 'jquery'" rel="tag">jquery</a> <a href="../../questions/tagged/excel" class="post-tag grid--cell" title="show questions tagged 'excel'" rel="tag">excel</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Sep 18 '15 at 08:58">asked Sep 18 '15 at 08:58</time> <a href="../../users/5349696/hongseongnam" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5349696.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="홍성남" /> </a> <div class="s-user-card--info"> <a href="../../users/5349696/hongseongnam" class="s-user-card--link">홍성남</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badge">1</li> <li class="s-award-bling s-award-bling__bronze" title="1 bronze badge">1</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-29257316"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/29257316/how-to-print-and-export-kendo-grid-data-in-angular-js" class="question-hyperlink">How to Print and export kendo-grid data in angular js?</a></h3> <div class="excerpt">i am trying to add two functions to my project. One is to export the grid data as its views to an excel (i am using kendo-grid and the grid data has been formatted from the UI side) and the second one is to print the grid data with the grid lines. i…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/angularjs" class="post-tag grid--cell" title="show questions tagged 'angularjs'" rel="tag">angularjs</a> <a href="../../questions/tagged/printing" class="post-tag grid--cell" title="show questions tagged 'printing'" rel="tag">printing</a> <a href="../../questions/tagged/kendo-grid" class="post-tag grid--cell" title="show questions tagged 'kendo-grid'" rel="tag">kendo-grid</a> <a href="../../questions/tagged/export-to-excel" class="post-tag grid--cell" title="show questions tagged 'export-to-excel'" rel="tag">export-to-excel</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 25 '15 at 13:38">asked Mar 25 '15 at 13:38</time> <a href="../../users/2803474/user2803474" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2803474.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user2803474" /> </a> <div class="s-user-card--info"> <a href="../../users/2803474/user2803474" class="s-user-card--link">user2803474</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">21</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="9 bronze badges">9</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-68166067"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>-1</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/68166067/count-number-of-occurences-in-json-object-using-alasql" class="question-hyperlink">Count number of occurences in JSON object using ALASQL</a></h3> <div class="excerpt">I am trying to count the number of occurrences of certain property(TypeAlarme in my case) in a javascript object using ALASQL. Here is what i have tried let data = [{DepName: "Dept Test Code Blanc2",TypeAlarme: "BtnEtat 1"}, {DepName:…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/json" class="post-tag grid--cell" title="show questions tagged 'json'" rel="tag">json</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 28 '21 at 15:27">asked Jun 28 '21 at 15:27</time> <a href="../../users/9195987/riley-christian" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/9195987.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Riley Christian" /> </a> <div class="s-user-card--info"> <a href="../../users/9195987/riley-christian" class="s-user-card--link">Riley Christian</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">149</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="13 bronze badges">13</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-46167404"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>-1</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/46167404/grouping-objects-in-an-array-by-multiple-keys" class="question-hyperlink">Grouping objects in an array by multiple keys</a></h3> <div class="excerpt">Initially, I've this array: [{ "vendorid": 1, "vendorname": "Vendor1", "maxfilelimit": 2, "uploadfilename": "Voice1.xlsx" }, { "vendorid": 1, "vendorname": "Vendor1", "maxfilelimit": 2, "uploadfilename":…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/javascript" class="post-tag grid--cell" title="show questions tagged 'javascript'" rel="tag">javascript</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Sep 12 '17 at 03:24">asked Sep 12 '17 at 03:24</time> <a href="../../users/5729813/tushar-walzade" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5729813.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Tushar Walzade" /> </a> <div class="s-user-card--info"> <a href="../../users/5729813/tushar-walzade" class="s-user-card--link">Tushar Walzade</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">3,737</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="33 silver badges">33</li> <li class="s-award-bling s-award-bling__bronze" title="56 bronze badges">56</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-38882751"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>-1</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/38882751/delete-query-in-alasql" class="question-hyperlink">Delete query in Alasql</a></h3> <div class="excerpt">i am new to Alasql. In my nodejs code i have written below piece of code for delete an item. but it is not getting deleted. Any help? This is my create table query sqldb.exec('CREATE TABLE Cores ([node-id], name, [ip-address], [sw-version],…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/node.js" class="post-tag grid--cell" title="show questions tagged 'node.js'" rel="tag">node.js</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Aug 10 '16 at 20:16">asked Aug 10 '16 at 20:16</time> <a href="../../users/909792/kiran" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/909792.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Kiran" /> </a> <div class="s-user-card--info"> <a href="../../users/909792/kiran" class="s-user-card--link">Kiran</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">839</li> <li class="s-award-bling s-award-bling__gold" title="3 gold badges">3</li> <li class="s-award-bling s-award-bling__silver" title="15 silver badges">15</li> <li class="s-award-bling s-award-bling__bronze" title="45 bronze badges">45</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-35696837"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>-3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/35696837/sql-query-for-these-two-tables" class="question-hyperlink">SQL Query For These Two Tables</a></h3> <div class="excerpt">I have these two tables: Person Name Gender RegionID Bob Male 1 Mary Female 2 Jane Female 3 Chris Male 1 Paul Male 2 Matt Male 2 Jenny Female 1 Region ID Region 1 North 2 South 3 Central I…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/sql" class="post-tag grid--cell" title="show questions tagged 'sql'" rel="tag">sql</a> <a href="../../questions/tagged/join" class="post-tag grid--cell" title="show questions tagged 'join'" rel="tag">join</a> <a href="../../questions/tagged/alasql" class="post-tag grid--cell" title="show questions tagged 'alasql'" rel="tag">alasql</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Feb 29 '16 at 10:11">asked Feb 29 '16 at 10:11</time> <a href="../../users/3815810/submits" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3815810.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Submits" /> </a> <div class="s-user-card--info"> <a href="../../users/3815810/submits" class="s-user-card--link">Submits</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">229</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badge">2</li> <li class="s-award-bling s-award-bling__bronze" title="10 bronze badge">10</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/alasql_page=14" rel="prev" title="Go to page 14">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/alasql_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/alasql_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/alasql_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/alasql_page=14" rel="" title="Go to page 14">14</a> <div class="s-pagination--item is-selected">15</div> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>