zeanium-node
Advanced tools
Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "zeanium-node", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Zeanium for Node.js, simple http server and custome your business.", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"mysql": "^2.13.0", | ||
"zeanium": "^1.1.16" | ||
"zeanium": "^1.1.17" | ||
}, | ||
@@ -39,0 +39,0 @@ "preferGlobal": "true", |
@@ -67,2 +67,6 @@ /** | ||
zn.each(fields, function (field, index){ | ||
if((field).toString().indexOf(' as ')!=-1){ | ||
_fields.push(field); | ||
return -1; | ||
} | ||
if(typeof index == 'string'){ | ||
@@ -97,3 +101,8 @@ _fields.push(field + ' as ' + index); | ||
argv.table = this.getMeta('table'); | ||
argv.fields = this.getSelectFields(argv.fields); | ||
if(typeof argv.fields == 'string' && argv.fields.indexOf(' as ')!=-1){ | ||
}else { | ||
argv.fields = this.getSelectFields(argv.fields); | ||
} | ||
return zn.sql.select(argv); | ||
@@ -100,0 +109,0 @@ }, |
@@ -42,3 +42,7 @@ /** | ||
_sql = _argv.shift(); | ||
return this.__query(_sql.format(_argv)); | ||
if(_argv.length){ | ||
_sql = _sql.format(_argv); | ||
} | ||
return this.__query(_sql); | ||
}, | ||
@@ -45,0 +49,0 @@ __query: function (sql, config){ |
@@ -13,4 +13,7 @@ /** | ||
paging: "select {fields} from {table} {where} {order} {group} {limit};select count(*) as count from {table} {where};" | ||
} | ||
}, SQLS_DEFAULT = { | ||
fields: '*' | ||
}; | ||
return zn.sql = zn.Class({ | ||
@@ -60,2 +63,3 @@ static: true, | ||
__format: function (sql, data){ | ||
data.fields = data.fields || '*'; | ||
return sql.format(SchemaSqlParser.parse(data)).replace(/\s+/g, ' '); | ||
@@ -62,0 +66,0 @@ //return sql.format(SchemaSqlParser.parse(data)).replace(/\s+/g, ' ').replace(/(^s*)|(s*$)/g, ''); |
@@ -33,4 +33,4 @@ zn.define(function () { | ||
router: null, | ||
value: function (model, store){ | ||
return this._store.beginTransaction(); | ||
value: function (){ | ||
return this._store.beginTransaction.apply(this._store, arguments); | ||
} | ||
@@ -41,3 +41,3 @@ }, | ||
value: function (){ | ||
return this._store.query.call(this, arguments); | ||
return this._store.query.apply(this._store, arguments); | ||
} | ||
@@ -44,0 +44,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
248852
5913
Updatedzeanium@^1.1.17