Permalink
Browse files

renamed to myorm

  • Loading branch information...
1 parent 87d9601 commit 82f2bb5f254d7bcda74e0a6b18f10fd50df70753 @langpavel committed Apr 16, 2012
Showing with 18 additions and 20 deletions.
  1. +4 −0 bin/myorm
  2. +1 −0 bin/myorm-cli.js
  3. +0 −4 bin/orm
  4. +0 −1 bin/orm-cli.js
  5. +3 −4 lib/db_reflection.js
  6. +10 −11 package.json
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env node
+
+require('./myorm-cli.js');
+
View
@@ -0,0 +1 @@
+console.log('myorm: this will be scaffold tool for node-myorm project');
View
@@ -1,4 +0,0 @@
-#!/usr/bin/env node
-
-require('./orm-cli.js');
-
View
@@ -1 +0,0 @@
-console.log('orm: this will be scaffold tool for node-orm project');
View
@@ -1,5 +1,4 @@
var fs = require('fs');
-var db = require('./db');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var log = function() {};
@@ -12,7 +11,7 @@ util.inherits(DbReflection, EventEmitter);
DbReflection.prototype.loadTables = function() {
var self = this;
- db.query('SHOW TABLES', function(err, rows, cols) {
+ this.constructor.database.query('SHOW TABLES', function(err, rows, cols) {
if(err) {
self.emit('error', err);
return;
@@ -31,7 +30,7 @@ DbReflection.prototype.loadTable = function(table) {
var self = this;
- db.query('SELECT '+
+ this.constructor.database.query('SELECT '+
'a.COLUMN_NAME as name,'+
'a.DATA_TYPE as type, '+
'a.COLUMN_TYPE as sql_type, '+
@@ -43,7 +42,7 @@ DbReflection.prototype.loadTable = function(table) {
'a.EXTRA as extra '+
'FROM information_schema.columns as a ' +
'where a.table_name = ? AND a.table_schema = ? ' +
- 'order by a.ORDINAL_POSITION', [table,db.conf.database],
+ 'order by a.ORDINAL_POSITION', [table,this.constructor.database.database],
function(err, rows, cols) {
if(err) {
self.emit('error', err);
View
@@ -1,5 +1,5 @@
{
- "name": "orm",
+ "name": "myorm",
"description": "Object-relational mapper (for MySQL at this time)",
"keywords": [
"orm",
@@ -9,17 +9,20 @@
],
"version": "0.0.0",
"author": "Pavel Lang <langpavel@phpskelet.org>",
- "homepage": "https://github.com/langpavel/node-orm",
- "preferGlobal": false,
+ "homepage": "https://github.com/langpavel/node-myorm",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/langpavel/node-myorm.git"
+ },
"bugs": {
- "url": "https://github.com/langpavel/node-orm/issues"
+ "url": "https://github.com/langpavel/node-myorm/issues"
},
+ "main": "./lib/index.js",
+ "bin": "./bin/myorm-cli.js",
"directories": {
"lib": "./lib",
"bin": "./bin"
},
- "main": "./lib/index.js",
- "bin": "./bin/orm-cli.js",
"engines": {
"node": "*"
},
@@ -34,14 +37,10 @@
"mysql-pool": "*"
},
"bin": {
- "orm": "./bin/orm"
+ "myorm": "./bin/myorm"
},
"scripts": {
"test": "nodeunit tests tests/columns",
"prepublish": "npm prune && npm test && git push"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/langpavel/node-orm.git"
}
}

0 comments on commit 82f2bb5

Please sign in to comment.