Skip to content

Commit

Permalink
Merge branch 'release/0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
agershun committed May 5, 2015
2 parents d38cade + 8fb9dbd commit 9941350
Show file tree
Hide file tree
Showing 51 changed files with 8,299 additions and 2,604 deletions.
6 changes: 3 additions & 3 deletions .bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alasql",
"description":"AlaSQL - JavaScript SQL database library",
"version": "0.1.0",
"description":"AlaSQL.js - JavaScript SQL database library for relational and graph data with support of localStorage, IndexedDB, and Excel",
"version": "0.1.1",
"license": "MIT",
"keywords": [
"sql",
Expand Down Expand Up @@ -41,7 +41,7 @@
"gulp-concat-sourcemap":"1.3.1",
"gulp-shell":"0.4.1",
"jison":"0.4.15",
"lodash":"3.7.0",
"lodash":"3.7.0"
},
"ignore": [
"src",
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Changelog

### 0.1.1 "Milano" (03.05.2015 - ...05.2015)
* XLSXML() into- function with colors
* $$hashKey - remove Angular's key
* CREATE VERTEX, CREATE EDGE
* SEARCH objects
* SEARCH graph
* "name" as name for graph vertices and edges
* Added INSTANCEOF selector
* Added CLASS selector
* * selector, + selector, ? selector, !selector for SEARCH in JSON and graphs
* XML() from function
* SEARCH INTO functions
### 0.1.0 (aka 0.0.52) "Venice" (02.05.2015 - 03.05.2015)
* Added INFORMATION_SCHEMA from variable
* Fixed localstorage dropTable with AUTOCOMMIT OFF
* STD() function added, STDEV(),STEDEVP(),VAR(),VARP()
* DISTINCT and ALL with custom aggregators (like STD(DISTINCT a))
* UNION problem fixed
* IE9 - save plain text and XLX()
* IE9 - save plain text and XLS()
### 0.0.51 "Rimini" (23.04.2015 - 02.05.2015)
* alasql.options.modifier flag added
Expand Down
74 changes: 69 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AlaSQL.js - JavaScript SQL database library with support of localStorage, IndexedDB, and Excel
# AlaSQL.js - JavaScript SQL database library for relational and graph data with support of localStorage, IndexedDB, and Excel

Version: 0.1.0 (aka 0.0.52) "Venice" Date: May 3, 2015 [Change log](CHANGELOG.md), [Release plan](RELEASES.md)
Version: 0.1.1 "Milano" Date: May 5, 2015 [Change log](CHANGELOG.md), [Release plan](RELEASES.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 @@ -19,9 +19,9 @@ AlaSQL is easy to use! Just add [alasql.min.js](alasql.min.js) file (about 280Kb
Run this sample in [jsFiddle](http://jsfiddle.net/agershun/15r1y9hg/) or try it in <a href="http://alasql.org/console?CREATE TABLE cities (city string, population number);INSERT INTO cities VALUES ('Rome',2863223), ('Paris',2249975),('Berlin',3517424), ('Madrid',3041579);SELECT * FROM cities WHERE population < 3500000 ORDER BY population DESC">AlaSQL console</a>.

Please use:
* [AlaSQL Forum](https://groups.google.com/d/forum/alasql) for discussions
* [Issues](https://github.com/agershun/alasql/issues) to report bugs.
* [Feathub](http://feathub.com/agershun/alasql) Please, vote for new features
* [Feathub](http://feathub.com/agershun/alasql) to vote for new features
* [AlaSQL Forum](https://groups.google.com/d/forum/alasql) for discussions

## Documentation

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

## What is new?

### Documents and graphs paradigms

AlaSQL now is multi-paradigm database with support documents and graphs. Below you can find an example
how to create graph:
```js
alasql('SET @olga = (CREATE VERTEX "Olga")');
alasql('SET @helen = (CREATE VERTEX "Helen")');
alasql('SET @pablo = (CREATE VERTEX "Pablo")');
alasql('SET @andrey = (CREATE VERTEX "Andrey")');
alasql('SET @alice = (CREATE VERTEX "Alice")');
alasql('CREATE EDGE FROM @olga TO @pablo');
alasql('CREATE EDGE FROM @helen TO @andrey');
alasql('CREATE EDGE FROM @pablo TO @alice');
alasql('CREATE EDGE FROM @andrey TO @alice');
```
and search over it with SEARCH operator:
```js
// Whom loves Olga?
alasql('SEARCH "Olga" >> name');
// ['Pablo']

// Whom loves Olga's love objects?
alasql('SEARCH "Olga" >> >> name');
// ['Alice']

// Who loves lovers of Alice?
alasql('SEARCH IF(>> >> "Alice") name');
// ['Olga','Helen']

```
You also make searches over JSON object with SEARCH operator:
```js
var data = {a:{a:{a:{a:{b:10}}}},b:20};
var res = alasql('SEARCH a b FROM ?',[data]);
var res = alasql('SEARCH (a)+ b FROM ?',[data]);
var res = alasql('SEARCH (a a)+ b FROM ?',[data]);
var res = alasql('SEARCH (a a a)+ b FROM ?',[data]);
var res = alasql('SEARCH (/)+ b FROM ?',[data]);
var res = alasql('SEARCH /+b FROM ?',[data]);
var res = alasql('SEARCH a* b FROM ?',[data]);
var res = alasql('SEARCH a+ b FROM ?',[data]);
var res = alasql('SEARCH a? b FROM ?',[data]);
```
Please see more examples in test300-test304.js. All these features will be documented soon.

### Version upgrade from 0.0.51 to 0.1.0

AlaSQL now is 6 month old and it can change minor release number from 0.0 to 0.1.
Expand All @@ -68,7 +113,26 @@ Other areas of future improvements (please add and vote for new features on [Fea
* Support key-value external storages and NoSQL databases
* Add some missing SQL functionality (constraints, foreign keys, etc.)

### AlaSQL export to Excel with colors
### AlaSQL export to Excel with colors (2)

Now AlaSQL can save files to Excel and LibreOffice formats with colors and other
Excel formatting functions. This function also work in IE9. This is a code sample:

```js
var mystyle = {
headers:true,
column: {style:{Font:{Bold:"1"}}},
rows: {1:{style:{Font:{Color:"#FF0077"}}}},
cells: {1:{1:{
style: {Font:{Color:"#00FFFF"}}
}}}
};
alasql('SELECT * INTO XLSXML("restest280b.xls",?) FROM ?',[mystyle,data]);
```
See the working example in [jsFiddle](http://jsfiddle.net/95j0txwx/7/)


### AlaSQL export to Excel with colors (1)

Now AlaSQL can export data to XLS format with coloring cells

Expand Down
6 changes: 2 additions & 4 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@

## Next Releases:

### Version "Bernini" 0.1.0 (9.05.2015)
* Recordset columns
* UNION bug fixed
* IE9 save file problem fixed
### Version "Firenze" 0.1.2 (9.05.2015)
* CREATE GRAPH
140 changes: 139 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,147 @@
# TO DO

This file contanis unstructured ideas for future development of Alasql.
This file contanis unstructured ideas for future development of AlaSQL.

## Ideas

Add ! operator;



#LITERAL a!length(10)
#NUMBER
`
n->length
n!length

city:country:name

#Andrey!city!country!name
#Andrey:city:country:name

#Andrey->city!country!name

search #Andrey :Person ok(city!country!name = "Italy")
search #Andrey !Person ok(city:country:name = "Italy")
search class(Person) #Andrey ok(city:country:name = "Italy")

! ->

#100!name

#NUMBER
!LITERAL

!expression -> objects['expression']


city!country!name
city->country->name

database.table
table.column

"object"!"property"
@a!name


alasql('SEARCH #Andrey PATH(#Napoleon) SET(color="red")');


alasql('create graph Andrey, Napoleon, Josephine,Louis, Andrey >> Josephine, Louis>>Josephine, Jpsephine >> Napoleopn');
alasql('search edge set(color="black")');
alasql('search !Andrey path(!Napoleon) set(color="red")');

search attr() / Books from xml("my.xml")


alasql('create graph from gml("my.gml")');


var force = d3.layout.force()
.charge(-120)
.linkDistance(30)
.size([width, height]);
.nodes(alasql('search vertex into d3()'))
.links(alasql('search edge into d3()'))
.start();



.forEach(function(edge){
edge.color = 'red';
});

d3 graphs and AlaSQL

d3
node : index
edges:
source: index
target: index


;
SEATCH EDGE INTO D3LINKS()

alasql('CREATE GRAPH FROM TXT("mynet.txt")');

Andrey,
{name:"yes"},
Andrey>loves>Masha {name:"Masha"}

var force = d3.layout.force()
.charge(-120)
.linkDistance(30)
.size([width, height]);
.nodes(alasql('SEARCH !Napoleon >> D3NODE()'))
.links(alasql('SEARCH !Napoleon > D3LINK()'))
.start();

alasql('search >>? d3node()')



>> >k>
2. SEARCH JSON
3. CREATE GRAPH

### XLSXML
Simplify with https://technet.microsoft.com/en-us/magazine/2006.01.blogtales.aspx

### Graph

SEARCH FROM {a:1};
{a:1}
SEARCH a FROM {a:1};
[1]
SEARCH FROM [1,2];
[1,2]
SEARCH {a:_} FROM [1,2];
[{a:1},{a:2}]
SEARCH AS @x (IDX() < 10) @x FROM [1,2];
[1,2]



SEARCH {a:1} a;
[1]
SEARCH a FROM {a:1};
[1]
SEARCH a FROM {a:{b:1}};
[{b:1}]
SEARCH a b FROM {a:{b:1}};
[1]
SEARCH > loves: > FROM @Alice;

SEARCH (a=1) AS @c {b:b,a:@c->a} FROM @[{a:1,b:10},{a:2,b:20}];

CREATE GRAPH @Alice, Bob, @Alice > loves: > @Bob;
SEARCH Alice > loves > IN Person;



### Graph Database

#### Edges & Vertices
Expand Down
2,853 changes: 2,023 additions & 830 deletions alasql.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions console/alasql.min.js

Large diffs are not rendered by default.

2,853 changes: 2,023 additions & 830 deletions dist/alasql.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/alasql.js.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions dist/alasql.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ gulp.task('js-merge', function () {
'./src/25queryclass.js',
'./src/28yy.js',
'./src/30statements.js',
'./src/35search.js',
'./src/38query.js',
'./src/39dojoin.js',
'./src/40select.js',
Expand Down Expand Up @@ -477,8 +478,10 @@ gulp.task('js-merge', function () {
'./src/80console.js',
'./src/81commit.js',
'./src/830into.js',
'./src/831xl.js',
'./src/831xls.js',
'./src/832xlsxml.js',
'./src/84from.js',
'./src/843xml.js',
'./src/85help.js',
'./src/86print.js',
'./src/87source.js',
Expand Down
Loading

0 comments on commit 9941350

Please sign in to comment.