Comparing version 0.0.29 to 0.0.30
@@ -0,1 +1,7 @@ | ||
0.0.30 / 2010-08-11 | ||
================== | ||
* Added database schema generator for MySQL | ||
* Fixed database schema validator | ||
0.0.29 / 2010-08-10 | ||
@@ -2,0 +8,0 @@ ================== |
@@ -103,5 +103,6 @@ (function(db) { | ||
// | ||
db.schema.check = function(databaseSchema, template, path) { | ||
db.schema.validate = function(databaseSchema, consoleOutput, template, path) { | ||
if (!template) template = 'schema'; | ||
var tpl = templates[template]; | ||
var tpl = templates[template], | ||
errors = []; | ||
if (!path) path = ''; | ||
@@ -123,3 +124,3 @@ var isValid = true; | ||
/**/ if (itemTemplate.length == 1) isItemValid = (itemType == itemTemplate[0]); | ||
else if (itemTemplate.length == 2) isItemValid = db.schema.check(item, itemTemplate[1], itemPath); | ||
else if (itemTemplate.length == 2) isItemValid = db.schema.validate(item, consoleOutput, itemTemplate[1], itemPath); | ||
else if (itemTemplate.length == 3) { | ||
@@ -129,4 +130,7 @@ for (var hashKey in item) { | ||
itemPath = path+'.'+key+'.'+hashKey; | ||
isItemValid = db.schema.check(hashItem, itemTemplate[2], itemPath); | ||
console.log('Check '+itemPath+': '+(isItemValid ? "valid".green : "error".red)); | ||
isItemValid = db.schema.validate(hashItem, consoleOutput, itemTemplate[2], itemPath); | ||
if (!isItemValid) { | ||
errors.push(itemPath); | ||
if (consoleOutput) console.log('Error in '+itemPath.red); | ||
} | ||
isValid = isValid && isItemValid; | ||
@@ -140,9 +144,15 @@ } | ||
if (itemPath) { | ||
console.log('Check '+itemPath+': '+(isItemValid ? "valid".green : "error".red)); | ||
if (!isItemValid) { | ||
errors.push(itemPath); | ||
if (consoleOutput) console.log('Error in '+itemPath.red); | ||
} | ||
isValid = isValid && isItemValid; | ||
} | ||
} | ||
return isValid; | ||
return { | ||
valid: isValid, | ||
errors: errors | ||
}; | ||
} | ||
} (global.db = global.db || {})); |
@@ -95,2 +95,14 @@ if (typeof(window) != 'undefined') window.global = window; | ||
String.prototype.lpad = function(padChar, length) { | ||
var padCount = length - this.length; | ||
if (padCount<0) padCount = 0; | ||
return Array(padCount).join(padChar)+this; | ||
} | ||
String.prototype.rpad = function(padChar, length) { | ||
var padCount = length - this.length; | ||
if (padCount<0) padCount = 0; | ||
return this+Array(padCount).join(padChar); | ||
} | ||
// Add toISOString support if no native support (e.g. "2012-01-01T12:30:15.120Z") | ||
@@ -97,0 +109,0 @@ if (!Date.prototype.toISOString) { |
{ | ||
"name": "impress", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Impressive totalitarian style multipurpose web application server. All decisions are made. Ready for applied development.", |
@@ -8,5 +8,6 @@ module.exports = { | ||
caption: "CMS Skins", | ||
comment: "CMS Skins", | ||
fields: { | ||
SkinId: { caption: "Id", type: "xid" }, | ||
SkinName: { caption: "Skin Name", type: "str", size: 32, index: { unique: "xtrue" } }, | ||
SkinId: { caption: "Id", type: "id" }, | ||
SkinName: { caption: "Skin Name", type: "str", size: 32, index: { unique: true } }, | ||
CssVariables: { caption: "CSS Variables", type: "text", subtype: "json" } | ||
@@ -13,0 +14,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2124010
211
39364
3