Skip to content

Commit

Permalink
Merge branch 'release/0.1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
agershun committed May 31, 2015
2 parents a19a787 + a615bfe commit 91f4998
Show file tree
Hide file tree
Showing 1,610 changed files with 102,194 additions and 116,952 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.js - JavaScript SQL database library for relational and graph data manipulation with support of localStorage, IndexedDB, and Excel",
"version": "0.1.8",
"version": "0.1.9",
"license": "MIT",
"keywords": [
"sql",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"js-xls": "~0.7.5",
"js-xlsx":"0.8.0",
"xlsx":"0.8.0",
"es6-promise":"2.1.0"
},
"devDependencies": {
Expand All @@ -54,4 +54,4 @@
"bin",
"lib"
]
}
}
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### 0.1.9 "Torino" (29.05.2015 - 31.05.2015)
* SERIAL data type added
* Changed package.json
* Sample application AlaSQL Codex (alasql.org/codex)
* Changed type conversion procedure for INTEGER, JSON and other types
* TypeScript definition file: alasql.d.ts

### 0.1.8 "Pisa" (22.05.2015 - 28.05.2015)
* SELECT FROM syntax
* Export to multiple sheets workbook
Expand All @@ -9,7 +16,6 @@
* VALUE OF SELECT operator
* bitHound file


### 0.1.7 "Parma" (17.05.2015 - 22.05.2015)
* Fixed BETWEEN AND and AND parsing priority bug (KPI1:95%)
* Fixed SUM() with NULL(undefined) values
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ AlaSQL - ([à la] (http://en.wiktionary.org/wiki/%C3%A0_la) [SQL](http://en.wiki

### This release:

- Version: 0.1.8 "Pisa"
- Updated: May 28, 2015,
- Version: 0.1.9 "Torino"
- Updated: May 31, 2015,
- Test cover: [SQLLOGICTEST=62%, NIST=24%](TESTLOG.md)
- [Change log](CHANGELOG.md)
- [Release plan](RELEASES.md).
Expand Down Expand Up @@ -96,12 +96,12 @@ and require the alasql.js file

## Why we are proud of AlaSQL?

* AlaSQL ♥ d3.js [see why](#d3js--alasql)
* AlaSQL ♥ Meteor [see why](#alasql-and-meteor)
* AlaSQL ♥ Angular.js [see why](#angularjs-and-alasqljs)
* AlaSQL ♥ Google Maps [see why](#google-maps--alasql)
* AlaSQL ♥ your JSON data [see why](#javascript-sugar)
* AlaSQL ♥ Google Spreadsheets [see why](#google-maps--alasql)
* AlaSQL ♥ d3.js [see why](https://github.com/agershun/alasql/wiki/readme#d3js--alasql)
* AlaSQL ♥ Meteor [see why](https://github.com/agershun/alasql/wiki/readme#alasql-and-meteor)
* AlaSQL ♥ Angular.js [see why](https://github.com/agershun/alasql/wiki/readme#angularjs-and-alasqljs)
* AlaSQL ♥ Google Maps [see why](https://github.com/agershun/alasql/wiki/readme#google-maps--alasql)
* AlaSQL ♥ your JSON data [see why](https://github.com/agershun/alasql/wiki/readme#javascript-sugar)
* AlaSQL ♥ Google Spreadsheets [see why](https://github.com/agershun/alasql/wiki/readme#google-maps--alasql)
* Search paths in graph data
* Read and write Excel, CSV, TAB, JSON, and text files to/from the database
* Got some CPU intensive SQL? AlaSQL plays nice as a WebWorker
Expand Down
1 change: 1 addition & 0 deletions console/alasql-worker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions console/alasql.min.js

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions dist/alasql.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Type definitions for alasql.js v.0.1.8
// Project: https://github.com/agershun/alasql
// Definitions by: Andrey Gershun <https://github.com/agershun>
// Definitions: https://github.com/borisyankov/DefinitelyTyped


interface AlaSQLCallback {
(data?:any,err?:Error):void
}

interface AlaSQLOptions {
errorlog: boolean;
valueof :boolean
dropifnotexists :boolean; // DROP database in any case
datetimeformat :string; // How to handle DATE and DATETIME types
casesensitive :boolean; // Table and column names are case sensitive and converted to lower-case
logtarget :string; // target for log. Values: 'console', 'output', 'id' of html tag
logprompt :boolean; // Print SQL at log
modifier :any; // values: RECORDSET, VALUE, ROW, COLUMN, MATRIX, TEXTSTRING, INDEX
columnlookup:number; // How many rows to lookup to define columns
autovertex:boolean;// Create vertex if not found
usedbo:boolean; // Use dbo as current database (for partial T-SQL comaptibility)
autocommit:boolean; // AUTOCOMMIT ON | OFF
cache:boolean; // Use cache
nocount:boolean;// for SET NOCOUNT OFF
nan:boolean;// Check for NaN and convert it to undefined
angularjs :boolean;
tsql:boolean;
mysql:boolean;
postgres:boolean;
oracle:boolean;
sqlite:boolean;
orientdb:boolean;
}

// Compiled Statement
interface AlaSQLStatement {
(params?:any,cb?:AlaSQLCallback,scope?:any):any;
}

// Abstract Syntax Tree
interface AlaSQLAST {
compile(databaseid:string):AlaSQLStatement;
}

interface AlaSQL {
(sql:any,params?:any,cb?:AlaSQLCallback,scope?:any):any;
parse(sql):AlaSQLAST;
options:AlaSQLOptions;
error: Error;
}

declare var alasql : AlaSQL;

39 changes: 27 additions & 12 deletions dist/alasql.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*! AlaSQL v0.1.9 (c) 2014-2015 Andrey Gershun | alasql.org/license */
/*
@module alasql
@version 0.1.8
Expand Down Expand Up @@ -125,7 +126,7 @@ var alasql = function alasql(sql, params, cb, scope) {
Current version of alasql
@constant {string}
*/
alasql.version = "0.1.8";
alasql.version = "0.1.9";

/**
Debug flag
Expand Down Expand Up @@ -10526,36 +10527,46 @@ alasql.stdfn.CONVERT = function(value, args) {
}
};

var udbtypeid = args.dbtypeid.toUpperCase();

if(args.dbtypeid == 'Date') {
return new Date(val);
} else if(args.dbtypeid.toUpperCase() == 'DATE') {
} else if(udbtypeid == 'DATE') {
var d = new Date(val);
var s = d.getFullYear()+"."+("0"+(d.getMonth()+1)).substr(-2)+"."+("0"+d.getDate()).substr(-2);
return s;
} else if(args.dbtypeid == 'DATETIME') {
} else if(udbtypeid == 'DATETIME') {
var d = new Date(val);
var s = d.getFullYear()+"."+("0"+(d.getMonth()+1)).substr(-2)+"."+("0"+d.getDate()).substr(-2);
s += " "+("0"+d.getHours()).substr(-2)+":"+("0"+d.getMinutes()).substr(-2)+":"+("0"+d.getSeconds()).substr(-2);
s += '.'+("00"+d.getMilliseconds()).substr(-3)
return s;
} else if(args.dbtypeid.toUpperCase() == 'STRING') {
return ""+val;
} else if(args.dbtypeid.toUpperCase() == 'NUMBER' || args.dbtypeid == 'FLOAT') {
} else if(['NUMBER','FLOAT'].indexOf(udbtypeid)>-1) {
return +val;
} else if(args.dbtypeid.toUpperCase() == 'MONEY') {
} else if(['MONEY'].indexOf(udbtypeid)>-1) {
var m = +val;
return (m|0)+((m*100)%100)/100;
} else if(args.dbtypeid.toUpperCase() == 'BOOLEAN') {
} else if(['BOOLEAN'].indexOf(udbtypeid)>-1) {
return !!val;
} else if(args.dbtypeid.toUpperCase() == 'INT') {
} else if(['INT','INTEGER','SMALLINT','BIGINT','SERIAL','SMALLSERIAL','BIGSERIAL'].indexOf(args.dbtypeid.toUpperCase())>-1) {
return val|0;
} else if(args.dbtypeid.toUpperCase() == 'VARCHAR' || args.dbtypeid == 'NVARCHAR') {
} else if(['STRING','VARCHAR','NVARCHAR', 'CHARACTER VARIABLE'].indexOf(args.dbtypeid.toUpperCase())>-1) {
if(args.dbsize) return (""+val).substr(0,args.dbsize);
else return ""+val;
} else if(args.dbtypeid.toUpperCase() == 'CHAR' || args.dbtypeid == 'NCHAR') {
} else if(['CHAR','CHARACTER', 'NCHAR'].indexOf(udbtypeid)>-1) {
return (val+(new Array(args.dbsize+1).join(" "))).substr(0,args.dbsize);
//else return ""+val.substr(0,1);
}
} else if(['DECIMAL','NUMERIC'].indexOf(udbtypeid)>-1) {
var m = +val;
var fxd = Math.pow(10,args.dbpecision);
return (m|0)+((m*fxd)%fxd)/fxd;
} else if(['JSON'].indexOf(udbtypeid)>-1) {
if(typeof val == 'object') return val;
try {
return JSON.parse(val);
} catch(err) { throw new Error('Cannot convert string to JSON');};
};
return val;
};


Expand Down Expand Up @@ -10650,6 +10661,10 @@ yy.CreateTable.prototype.execute = function (databaseid, params, cb) {
this.columns.forEach(function(col) {
var dbtypeid = col.dbtypeid;
if(!alasql.fn[dbtypeid]) dbtypeid = dbtypeid.toUpperCase();

// Process SERIAL data type like Postgress
if(['SERIAL','SMALLSERIAL','BIGSERIAL'].indexOf(dbtypeid)>-1) col.identity = {value:1,step:1};

var newcol = {
columnid: col.columnid,
dbtypeid: dbtypeid,
Expand Down
10 changes: 5 additions & 5 deletions dist/alasql.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ gulp.task('copy-console-org', function(){

/************************/

// Echo plugin
gulp.task('typescript', function(){
gulp.src(['./src/typescript/alasql.d.ts'])
.pipe(gulp.dest('./dist'));
});


// Echo plugin
gulp.task('plugin-plugins', function(){
gulp.src([
Expand Down Expand Up @@ -242,6 +249,7 @@ gulp.task('default', ['js-merge' /*, 'jison-compile', 'jison-lex-compile' */], f
gulp.watch('./src/99worker*.js',function(){ gulp.run('js-merge-worker'); });
gulp.watch('./src/alasqlparser.jison',function(){ gulp.run('jison-compile'); });

gulp.watch('./src/typescript/alasql.d.ts',function(){ gulp.run('typescript'); });
gulp.watch('./src/echo/*.js',function(){ gulp.run('plugin-plugins'); });
gulp.watch('./src/md/*.js',function(){ gulp.run('plugin-plugins'); });
gulp.watch('./src/prolog/*.js',function(){ gulp.run('plugin-prolog'); });
Expand Down
4 changes: 2 additions & 2 deletions meteor/.versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
agershun:[email protected].17
local-test:agershun:[email protected].17
agershun:[email protected].18
local-test:agershun:[email protected].18
[email protected]
[email protected]
Loading

0 comments on commit 91f4998

Please sign in to comment.