Installations
npm install node-red-contrib-alasql
Developer Guide
Typescript
No
Module System
N/A
Node Version
12.14.0
NPM Version
6.14.11
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
HTML (62.15%)
JavaScript (37.85%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
AlaSQL
Download Statistics
Total Downloads
98,703
Last Day
26
Last Week
285
Last Month
1,384
Last Year
5,538
GitHub Statistics
MIT License
9 Stars
107 Commits
11 Forks
7 Watchers
10 Branches
7 Contributors
Updated on Dec 28, 2024
Package Meta Information
Latest Version
2.0.2
Package Id
node-red-contrib-alasql@2.0.2
Unpacked Size
71.01 kB
Size
22.82 kB
File Count
13
NPM Version
6.14.11
Node Version
12.14.0
Total Downloads
Cumulative downloads
Total Downloads
98,703
Last Day
-61.2%
26
Compared to previous day
Last Week
-18.6%
285
Compared to previous week
Last Month
213.1%
1,384
Compared to previous month
Last Year
-76.2%
5,538
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
AlaSQL and AlaFile node-red nodes
(c) 2017 Mathias Rangel Wulff, Andrey Gershun & Kim McKinley
node-red-contrib-alasql
The Node-red alasql
node lets you access javascript objects as if they were a SQL database. The alafile in/out
nodes lets you transform the AlaSQL results into .xlsx, .xls, .csv, .json, .tab, .tsv, or .txt files stored on the node-red server.
The package is a Node-red wrapping of AlaSQL providing fast SQL based in-memory data processing for BI and ERP applications and import-export files into XLSX, XLS, and other data formats. Especially useful when you have (many) different sources coming with data you want to join, filter and format.
Install
Go to your Node-RED user directory and install node-red-contrib-alasql
from npm:
1cd ~/.node-red 2npm install node-red-contrib-alasql
How to use an AlaSQL node
-
Write a valid SQL query in the
SQL query
parameter. It can hold several SQL queries separated by;
. -
Refer to input data in
msg.payload
with$0
in your SQL. Ifmsg.payload
is an array the first value will be$0
, the second$1
and so forth. -
The result will be returned in
msg.payload
Returned values
Default return format is an array of objects:
1[{name:'foo', age: 86}, {name:'bar', age:64}]
To manipulate output format please consult the use of VALUE OF
, MATRIX OF
, COLUMN OF
, ROW OF
, and RECORDSET OF
.
If several queries are executed (separated by ;
) the returned value will be an array with the result from each.
So - what can I do?
Execute SQL on your data and output the result.
This includes INSERT
, UPDATE
, DELETE
, VIEW
indexes and multiple levels of JOIN
, GROUP BY
, UNION
, ROLLUP()
, CUBE()
, GROUPING SETS()
, CROSS APPLY
, OUTER APPLY
, WITH SELECT
, and subqueries. See the wiki to compare supported features with SQL standards.
Please consult the AlaSQL wiki to understand the flexible nature of the library.
AlaFile - Import and Export files
You also can use alafile
component to perform import and export operations with files. The parameters include:
Name
- the name of the nodeFile name
- path to import or export fileFormat
- select file formatColums
- specify*
(star) for all columns or list them with comma likeone, two, three
. You also can use AlaSQL functions or even rename columns withAS
operator (see the AlaSQLSELECT
statement documentation)Headers
- include first line headers
Test Suite
The node-red-contrib-alasql test suite for AlaSQL flows is provided to ensure AlaSQL nodes are operating properly.
node-red-contrib-alasql contains a set of test flows to ensure the nodes are handling exceptions properly and running as expected. Existing flows can be exported/imported into the test suite for verification.
The test suite is kindly contributed by
Kim McKinley (PotOfCoffee2Go). Requests and comments are appreciated. Create an
issue and please mention @PotOfCoffee2Go
somewhere in the issue.
Running Alasql Test Suite
To run the Test Suite from an existing node-red installation that uses node-red-contrib-alasql
please do:
cd ~/.node-red/node_modules/node-red-contrib-alasql
npm run test-setup
npm test
This will
- Create a node-red user directory containing AlaSQL test flows of the version installed in ~/.node-red
- Setup the needed files for testing
- Start the test serving on port 8081
Next time you want to run your test you can skip step 2.
To change the port do a export PORT=8081
on Mac or set PORT=8081
on Win prior to running npm test
.
Running stand alone Test Suite
If you wish to test the current release of AlaSQL prior to going into production. In any directory:
git clone https://github.com/AlaSQL/node-red-contrib-alasql.git
cd node-red-contrib-alasql
npm install
npm run test-setup
npm test
The test suite uses the npm link
command which allows node-red to
automatically add AlaSQL nodes to node-red by default. To remove this behaviour,
issue a npm unlink
from the node-red-contrib-alasql directory cloned above.
Please note
As default the library works in-memory - so all unsaved data are reset when Node-RED closes. Please consult the wiki to read more about how to let data be persistent.
If you are not sure why this is funny - please find out more about "SQL injections":

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 2/7 approved changesets -- score normalized to 2
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 30 are checked with a SAST tool
Score
3.8
/10
Last Scanned on 2025-02-24
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More