Skip to content

Commit

Permalink
Merge branch 'release/0.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
agershun committed May 17, 2015
2 parents d049a55 + 017721a commit aa65211
Show file tree
Hide file tree
Showing 160 changed files with 914,105 additions and 18,308 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

### 0.1.6 "Palermo" (13.05.2015 - 17.05.2015)
* SET NOCOUNT OFF (for CREATE and INSERT)
* ROWNUM() and ROW_NUMBER() functions
* Promised version of alasql() - alasql.async() (based on es6-promises)
* SELECT * FROM Json
* SEARCH COMMA selector
* Fixed bug with ORDER BY 1,2,3
* Added subqueries for INSERT/DELETE/UPDATE
* First 'official' ECHO plugin released (REQUIRE ECHO)
* New catalogs added for future plugins
* Meteor package 'agershun:alasql'
* Changed readFile and readBinaryFile to read data from Meteor server
* Added alasql.path
* Test program improved

### 0.1.5 "San Marino" (12.05.2015 - 12.05.2015)
* Added Meteor package (agershun:alasql) - still does not work - skeleton
* Northwind test database - test for speed and SQL
Expand Down
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AlaSQL.js - JavaScript SQL database library for relational and graph data manipulation with support of localStorage, IndexedDB, and Excel

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

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.

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

## Documentation

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

## What is new?

### AlaSQL and Meteor Mongo collections
### AlaSQL plug-ins

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:
Now AlaSQL supports plugins system. To install the plugin you need to use REQUIRE statement, like:
```js
alasql('REQUIRE ECHO');
var res = alasql('ECHO 123'); // Returns simply 123
```
You can use the same command in browser or include plugins directly:
```html
<script src="alasql.min.js"></script>
<script src="alasql-echo.js"></script>
```
The list of packages will be prepared later.

### AlaSQL and Meteor

Now you can install AlaSQL in Meteor from [official package](https://atmospherejs.com/agershun/alasql):
```
meteor add agershun:alasql
```
It works on the client and the server side.

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:

```js
Template.body.helpers({
Expand Down Expand Up @@ -546,10 +567,13 @@ Usually, alasql.js works synchronously, but you can use callback.
});
```

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):
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):
```js
db.aexec('SELECT * FROM test').then(function(res){
console.log(res);
alasql.async('SELECT * FROM test')
}).then(function(res){
// Process data
}).catch(function(err){
// Process errors
});
```
You can use compile statements:
Expand Down
37 changes: 32 additions & 5 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Releases Plan

## Target
The target for AlaSQLdevelopment is a small compact library with size less than 200kb with support of:
a) significant subset of SQL-92 to use the same SQL code on the client and server
b) complex queries on the JavaScript arrays (including search and JSON traversing)
c) support some simple ETL operations (import-export from CSV and XLS formats)
d) database backend support (IndexedDB in the first)

Plus some other features, like graphs and others in plug-ins.

## Alasql Development Prioritites
1. Bugs, Speed, Memory Leaks, Better Code, JsDoc, Errors handling, Library Size, Compatibility (Browsers, Mobiles, SQLs)
2. Documentation, alasql.org website, Social Media, Alasql promotion, Article, Coockbook, Tutorial
Expand All @@ -13,8 +22,26 @@

## Next Releases:

1. Meteor package
2. Documentation, Bugs, Size
3. SQLLOGIC Tests
4. Like-OrientDB functionality
5. ADD COLUMN Problem
### May 2015 (AlaSQL 0.2)
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:
a) documentation
b) resolving bugs
c) document and refactoring code

The target of this phase is to pass SQLLOGIC test. I know, that current 250 unit tests is not enough for such big project.

### June-July 2015 (AlaSQL 0.3)
Plus, I have some features in the short list for the June-July 2015:
e) extend transactions support
f) add simple triggers or INSERT OR REPLACE operator
g) improve database backend functionality (IndexedDB, localStorage, fileStorage) - especially for mobile applications (Cordova, Meteor).

### August 2015 (AlaSQL 0.4)
h) split alasql.js into core and additional modules to reduce the size of the library
i) add OrientDB support to search over graphs
j) work with memory leaks

### September 2015: (AlaSQL 0.5)
k) improve parser to reduce its size, make it faster (especally for INSERT operator), split grammar files by modules


12 changes: 12 additions & 0 deletions TESTLOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Test log

This file contains a log of tests runned on the [select1.test](test-sql/sqllogic/test/select1.test) file from SQLLOGICTEST
package.

###May 17,2015 8:07

* tests - 1031
* parsed ok - 1031 (100%)
* run ok - 866 (84%)
* unclear - 46
* time - 6.4s
131 changes: 131 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,142 @@

This file contanis unstructured ideas for future development of AlaSQL.

SQLLOGICTEST; time, memory, scores;




search count(/) where(_>10), / name;
search / > loves > @y, / > loves >@y where(@x<>@y) return(@x,@y);

a > g > b
search / AS @x, / son(@x,@y); COMMA -> start from from again;

from where(age>36), where(a>23)


grandson(@a,@c) :- son(@a,@b),son(@b,@c);
:- son(A,B,C,C);
?- grandson(Alex,@x);

grandson(@a,@c) :- son(@a,@b),son(@b,@c);
SEARCH age FROM (QUERY grandson(@person,Alex));
SEARCH Alex > grandson > @x if(name > "X") name;

SEARCH (SELECT)
SEARCH name FROM ?- grandson(@person,Alex);

#22:123 {22:{123:{}}}

QUERY @e 213;

{$node:'$edge',$class:'son',$rel:[12,23,45,67]}
12: $out
23: $in
Others - do not count;



## Ideas

?- son(a,b);

@x >> @b :- @b >> @x;

CREATE GRAPH loves(Andrey,Vera) ; - alternative notation for edges
loves(Andrey, Vera, Semen);
$in, $out, ...

rel - $v[0], $v[1], $v[3]
> $v[1]; -- if edge
SEARCH loves(A,@x,B), land(@x);
loves (A,@x,B):- son(),b;

Eureka!!!


SELECT * FROM @[1,2,3] JOIN @[1,2,3]
SET modifier "value";
CREATE UNIQUE INDEX
CREATE INDEX
INSERT/DELETE/UPDATE indexes loop

Meteor Package
GEFX

PROLOG QUERY PROCESSOR OVER SQL DATA
====================================

pure prolog... modified prolog?

son(alex,bob).
son("Alex","Bob").

:- son(Alex,Bob);
father(@x,@y) :- son(@y,@x);
?- father(Bob,@x);

:- son(Alex,Bob);
{$class:'son',0:'Alex',1:'Bob'};

:- son(name1=Alex,name2=Bob);
{$class:'son',name1:'Alex',name2:'Bob'};

father(@x,@y) :- son(@y,@x);
{$class:'father',0:{vars:"x"},1:{vars:"y"},$rule:[{$class:'son',0:{vars:"y"},1:{vars:"x"},}]};

:- son(person1 "Alex",name2=Bob);





?- :rel {father:@x, son: "Alex"}, :son {son:@x};

pattern-matching
?- rel(father:@x, son:"Alex") rel(father=@y,son=@x) RETURNS @x,@y;
?- rel(@x, @y).
?- {son:@x, father:@y}, .

CLASS "father/4" [1,2];

son(a,b):-father(b,a);
son("David","Abraham");
$rule:"son",length:2, 0:"David",1:"Abraham"


:- son("Alex","David");
father(@x,@y) :- son(@y,@x);
?- father("David",@z);

How to reflects fact to JSON or GRAPH?

son("Alex","David").

{$id:10, $node:'RULE', ruleid: "son", args:["Alex", "David"]}
{$id:10, $node:'RULE', $class: "son", $arity:2, 0:"Alex", 1:"David"}

, son:"Andrey")

:- rel(papa:"David",son:"Alex");
?- rel(papa:"David",son:@x);

SELECT * FROM rel;

{$node:'RULE', $class: 'rel', papa:'David', son:'Alex'};
{$node:'RULE', $class: 'rel', papa:{vars:@x}, son:'Alex', $rule:[{},{},{},{}];

{$class: 'rel', papa:'David', son:'Alex'};
{$class: 'rel', $arity:1, papa:'David'};
{$class: 'rel', papa:{vars:@x}, son:'Alex', $rule:[{},{},{},{}];

CREATE CLASS rel;
INSERT INTO rel VALUES ("David", "Alex");
?- rel("David",@x);


RULE @x > brother > @y :- @z > father > @x, @z > father > @y, where(@x <> @y);




Expand Down
Loading

0 comments on commit aa65211

Please sign in to comment.