Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

impress

Package Overview
Dependencies
Maintainers
1
Versions
719
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

impress - npm Package Compare versions

Comparing version 0.0.29 to 0.0.30

lib/db.mysql.schema.js

6

HISTORY.md

@@ -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 @@ ==================

24

lib/db.schema.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc