Skip to content

Commit aa65211

Browse files
committed
Merge branch 'release/0.1.6'
2 parents d049a55 + 017721a commit aa65211

File tree

160 files changed

+914105
-18308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+914105
-18308
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
### 0.1.6 "Palermo" (13.05.2015 - 17.05.2015)
4+
* SET NOCOUNT OFF (for CREATE and INSERT)
5+
* ROWNUM() and ROW_NUMBER() functions
6+
* Promised version of alasql() - alasql.async() (based on es6-promises)
7+
* SELECT * FROM Json
8+
* SEARCH COMMA selector
9+
* Fixed bug with ORDER BY 1,2,3
10+
* Added subqueries for INSERT/DELETE/UPDATE
11+
* First 'official' ECHO plugin released (REQUIRE ECHO)
12+
* New catalogs added for future plugins
13+
* Meteor package 'agershun:alasql'
14+
* Changed readFile and readBinaryFile to read data from Meteor server
15+
* Added alasql.path
16+
* Test program improved
17+
318
### 0.1.5 "San Marino" (12.05.2015 - 12.05.2015)
419
* Added Meteor package (agershun:alasql) - still does not work - skeleton
520
* Northwind test database - test for speed and SQL

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AlaSQL.js - JavaScript SQL database library for relational and graph data manipulation with support of localStorage, IndexedDB, and Excel
22

3-
Version: 0.1.5 "San Marino" Date: May 12, 2015 [Change log](CHANGELOG.md), [Release plan](RELEASES.md)
3+
Version: 0.1.6 "Napoli" Date: May 17, 2015 [Change log](CHANGELOG.md), [Release plan](RELEASES.md), [Test log](TESTLOG.md)
44

55
AlaSQL - '[à la SQL](http://en.wiktionary.org/wiki/%C3%A0_la)' - 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.
66

@@ -22,6 +22,7 @@ Please use:
2222
* [Issues](https://github.com/agershun/alasql/issues) to report bugs.
2323
* [Feathub](http://feathub.com/agershun/alasql) to vote for new features
2424
* [AlaSQL Forum](https://groups.google.com/d/forum/alasql) for discussions
25+
* [AlaSQL Roadmap](https://trello.com/b/qxz65pVi/alasql-roadmap)
2526

2627
## Documentation
2728

@@ -49,9 +50,29 @@ Check AlaSQL vs other JavaScript SQL databases and data processing libraries:
4950

5051
## What is new?
5152

52-
### AlaSQL and Meteor Mongo collections
53+
### AlaSQL plug-ins
5354

54-
Now you can use Meteor collections as agruments. To do it simply store alasql.min.js to the client/lib directory and then apply SQL to Meteor Collections:
55+
Now AlaSQL supports plugins system. To install the plugin you need to use REQUIRE statement, like:
56+
```js
57+
alasql('REQUIRE ECHO');
58+
var res = alasql('ECHO 123'); // Returns simply 123
59+
```
60+
You can use the same command in browser or include plugins directly:
61+
```html
62+
<script src="alasql.min.js"></script>
63+
<script src="alasql-echo.js"></script>
64+
```
65+
The list of packages will be prepared later.
66+
67+
### AlaSQL and Meteor
68+
69+
Now you can install AlaSQL in Meteor from [official package](https://atmospherejs.com/agershun/alasql):
70+
```
71+
meteor add agershun:alasql
72+
```
73+
It works on the client and the server side.
74+
75+
Now you can use Meteor Collections as agruments. To do it simply store alasql.min.js to the client/lib directory and then apply SQL to Meteor Collections:
5576

5677
```js
5778
Template.body.helpers({
@@ -546,10 +567,13 @@ Usually, alasql.js works synchronously, but you can use callback.
546567
});
547568
```
548569

549-
or you can use aexec() - promised version of exec (in this case you need to install [es6-promise](https://www.npmjs.org/package/es6-promise) module for Node.js) (this feature is experimental and may be removed in a future to reduce dependices):
570+
or you can use async() - promised version of exec (in this case you need to install [es6-promise](https://www.npmjs.org/package/es6-promise) module for Node.js) (this feature is experimental and may be removed in a future to reduce dependices):
550571
```js
551-
db.aexec('SELECT * FROM test').then(function(res){
552-
console.log(res);
572+
alasql.async('SELECT * FROM test')
573+
}).then(function(res){
574+
// Process data
575+
}).catch(function(err){
576+
// Process errors
553577
});
554578
```
555579
You can use compile statements:

RELEASES.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Releases Plan
22

3+
## Target
4+
The target for AlaSQLdevelopment is a small compact library with size less than 200kb with support of:
5+
a) significant subset of SQL-92 to use the same SQL code on the client and server
6+
b) complex queries on the JavaScript arrays (including search and JSON traversing)
7+
c) support some simple ETL operations (import-export from CSV and XLS formats)
8+
d) database backend support (IndexedDB in the first)
9+
10+
Plus some other features, like graphs and others in plug-ins.
11+
312
## Alasql Development Prioritites
413
1. Bugs, Speed, Memory Leaks, Better Code, JsDoc, Errors handling, Library Size, Compatibility (Browsers, Mobiles, SQLs)
514
2. Documentation, alasql.org website, Social Media, Alasql promotion, Article, Coockbook, Tutorial
@@ -13,8 +22,26 @@
1322

1423
## Next Releases:
1524

16-
1. Meteor package
17-
2. Documentation, Bugs, Size
18-
3. SQLLOGIC Tests
19-
4. Like-OrientDB functionality
20-
5. ADD COLUMN Problem
25+
### May 2015 (AlaSQL 0.2)
26+
Now (May 2015) is the point, where I am decided to stop a little bit with development of new features, and do the homework with these priorities:
27+
a) documentation
28+
b) resolving bugs
29+
c) document and refactoring code
30+
31+
The target of this phase is to pass SQLLOGIC test. I know, that current 250 unit tests is not enough for such big project.
32+
33+
### June-July 2015 (AlaSQL 0.3)
34+
Plus, I have some features in the short list for the June-July 2015:
35+
e) extend transactions support
36+
f) add simple triggers or INSERT OR REPLACE operator
37+
g) improve database backend functionality (IndexedDB, localStorage, fileStorage) - especially for mobile applications (Cordova, Meteor).
38+
39+
### August 2015 (AlaSQL 0.4)
40+
h) split alasql.js into core and additional modules to reduce the size of the library
41+
i) add OrientDB support to search over graphs
42+
j) work with memory leaks
43+
44+
### September 2015: (AlaSQL 0.5)
45+
k) improve parser to reduce its size, make it faster (especally for INSERT operator), split grammar files by modules
46+
47+

TESTLOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Test log
2+
3+
This file contains a log of tests runned on the [select1.test](test-sql/sqllogic/test/select1.test) file from SQLLOGICTEST
4+
package.
5+
6+
###May 17,2015 8:07
7+
8+
* tests - 1031
9+
* parsed ok - 1031 (100%)
10+
* run ok - 866 (84%)
11+
* unclear - 46
12+
* time - 6.4s

TODO.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,142 @@
22

33
This file contanis unstructured ideas for future development of AlaSQL.
44

5+
SQLLOGICTEST; time, memory, scores;
6+
7+
8+
9+
10+
search count(/) where(_>10), / name;
11+
search / > loves > @y, / > loves >@y where(@x<>@y) return(@x,@y);
12+
13+
a > g > b
14+
search / AS @x, / son(@x,@y); COMMA -> start from from again;
15+
16+
from where(age>36), where(a>23)
17+
18+
19+
grandson(@a,@c) :- son(@a,@b),son(@b,@c);
20+
:- son(A,B,C,C);
21+
?- grandson(Alex,@x);
22+
23+
grandson(@a,@c) :- son(@a,@b),son(@b,@c);
24+
SEARCH age FROM (QUERY grandson(@person,Alex));
25+
SEARCH Alex > grandson > @x if(name > "X") name;
26+
27+
SEARCH (SELECT)
28+
SEARCH name FROM ?- grandson(@person,Alex);
29+
30+
#22:123 {22:{123:{}}}
31+
32+
QUERY @e 213;
33+
34+
{$node:'$edge',$class:'son',$rel:[12,23,45,67]}
35+
12: $out
36+
23: $in
37+
Others - do not count;
38+
39+
40+
541
## Ideas
642

43+
?- son(a,b);
44+
45+
@x >> @b :- @b >> @x;
46+
47+
CREATE GRAPH loves(Andrey,Vera) ; - alternative notation for edges
48+
loves(Andrey, Vera, Semen);
49+
$in, $out, ...
50+
51+
rel - $v[0], $v[1], $v[3]
52+
> $v[1]; -- if edge
53+
SEARCH loves(A,@x,B), land(@x);
54+
loves (A,@x,B):- son(),b;
55+
56+
Eureka!!!
57+
58+
59+
SELECT * FROM @[1,2,3] JOIN @[1,2,3]
60+
SET modifier "value";
61+
CREATE UNIQUE INDEX
62+
CREATE INDEX
63+
INSERT/DELETE/UPDATE indexes loop
64+
765
Meteor Package
866
GEFX
967

68+
PROLOG QUERY PROCESSOR OVER SQL DATA
69+
====================================
70+
71+
pure prolog... modified prolog?
72+
73+
son(alex,bob).
74+
son("Alex","Bob").
75+
76+
:- son(Alex,Bob);
77+
father(@x,@y) :- son(@y,@x);
78+
?- father(Bob,@x);
79+
80+
:- son(Alex,Bob);
81+
{$class:'son',0:'Alex',1:'Bob'};
82+
83+
:- son(name1=Alex,name2=Bob);
84+
{$class:'son',name1:'Alex',name2:'Bob'};
85+
86+
father(@x,@y) :- son(@y,@x);
87+
{$class:'father',0:{vars:"x"},1:{vars:"y"},$rule:[{$class:'son',0:{vars:"y"},1:{vars:"x"},}]};
88+
89+
:- son(person1 "Alex",name2=Bob);
90+
91+
92+
93+
94+
95+
?- :rel {father:@x, son: "Alex"}, :son {son:@x};
96+
97+
pattern-matching
98+
?- rel(father:@x, son:"Alex") rel(father=@y,son=@x) RETURNS @x,@y;
99+
?- rel(@x, @y).
100+
?- {son:@x, father:@y}, .
101+
102+
CLASS "father/4" [1,2];
103+
104+
son(a,b):-father(b,a);
105+
son("David","Abraham");
106+
$rule:"son",length:2, 0:"David",1:"Abraham"
107+
108+
109+
:- son("Alex","David");
110+
father(@x,@y) :- son(@y,@x);
111+
?- father("David",@z);
112+
113+
How to reflects fact to JSON or GRAPH?
114+
115+
son("Alex","David").
116+
117+
{$id:10, $node:'RULE', ruleid: "son", args:["Alex", "David"]}
118+
{$id:10, $node:'RULE', $class: "son", $arity:2, 0:"Alex", 1:"David"}
119+
120+
, son:"Andrey")
121+
122+
:- rel(papa:"David",son:"Alex");
123+
?- rel(papa:"David",son:@x);
124+
125+
SELECT * FROM rel;
126+
127+
{$node:'RULE', $class: 'rel', papa:'David', son:'Alex'};
128+
{$node:'RULE', $class: 'rel', papa:{vars:@x}, son:'Alex', $rule:[{},{},{},{}];
129+
130+
{$class: 'rel', papa:'David', son:'Alex'};
131+
{$class: 'rel', $arity:1, papa:'David'};
132+
{$class: 'rel', papa:{vars:@x}, son:'Alex', $rule:[{},{},{},{}];
133+
134+
CREATE CLASS rel;
135+
INSERT INTO rel VALUES ("David", "Alex");
136+
?- rel("David",@x);
137+
138+
139+
RULE @x > brother > @y :- @z > father > @x, @z > father > @y, where(@x <> @y);
140+
10141

11142

12143

0 commit comments

Comments
 (0)