Skip to content

Commit

Permalink
Merge pull request #584 from hochang/master
Browse files Browse the repository at this point in the history
mongodb connector
  • Loading branch information
shimonchayim committed Apr 8, 2013
2 parents d2f759b + 584a980 commit e197781
Show file tree
Hide file tree
Showing 29 changed files with 2,547 additions and 1,303 deletions.
3 changes: 3 additions & 0 deletions modules/app/lib/main.js
Expand Up @@ -57,6 +57,7 @@ exports.exec = function() {
option('-c, --config <configFile>', 'path to config', cwd + '/../config/dev.json').
option('-p, --port <port>', 'port to bind to', '3000').
option('-m, --monPort <monPort>', 'port for monitoring', 3001).
option('-conn, --connectors <connectors>', 'path of dir containing connectors', cwd + '/connectors').
option('-t, --tables <tables>', 'path of dir containing tables', cwd + '/tables').
option('-r, --routes <routes>', 'path of dir containing routes', cwd + '/routes').
option('-x, --xformers <xformers>', 'path of dir containing xformers', cwd + '/config/xformers.json').
Expand All @@ -82,6 +83,7 @@ exports.exec = function() {
config: program.config,
tables: program.tables,
routes: program.routes,
connectors: program.connectors,
xformers: program.xformers,
disableConsole: program.disableConsole,
disableQ: program.disableQ,
Expand Down Expand Up @@ -242,6 +244,7 @@ function createConsole(options, cluster, cb) {
},
'tables': program.tables,
'routes': program.routes,
'connectors': program.connectors,
'config': program.config,
'xformers': program.xformers,
'enable console': !disableConsole,
Expand Down
6 changes: 3 additions & 3 deletions modules/app/package.json
@@ -1,7 +1,7 @@
{
"author": "ql.io",
"name": "ql.io-app",
"version": "0.8.9",
"version": "0.8.10",
"repository": {
"type": "git",
"url": "https://github.com/ql-io/ql.io"
Expand All @@ -15,8 +15,8 @@
},
"dependencies": {
"commander": "1.0.0",
"ql.io-console": "0.8.8",
"ql.io-compiler": "0.8.4",
"ql.io-console": "0.8.9",
"ql.io-compiler": "0.8.5",
"winston": "0.6.2",
"express": "2.5.11",
"underscore": "1.3.3",
Expand Down
47 changes: 22 additions & 25 deletions modules/compiler/lib/compiler.js
Expand Up @@ -24,13 +24,14 @@ var ql = require('./peg/ql.js'),
exports.version = require('../package.json').version;

var cache = {};
exports.compile = function(script) {
exports.compile = function(script, loaded) {
assert.ok(script, 'script is undefined');

var compiled, cooked, cacheKey;

cacheKey = script;
cooked = cache[cacheKey];
cache['_tables'] = loaded
if(cooked) {
return cooked;
}
Expand Down Expand Up @@ -444,37 +445,33 @@ function introspectFrom(line, froms, symbols, parent) {
from = froms[j];
if(from.name.indexOf('{') === 0) {
refname = from.name.substring(1, from.name.length - 1);
dependency = symbols[refname];
if(dependency) {
if(line.assign === refname) {
throw new this.SyntaxError('Circular reference ' + line.assign);
}
else {
if(parent) {
addDep(parent, parent.dependsOn, dependency, symbols);
}
else {
addDep(line, line.dependsOn, dependency, symbols);
}
}
}

}
else if(symbols[from.name]) {
refname = from.name
dependency = symbols[refname];
if(dependency) {
if(line.assign === refname) {
throw new this.SyntaxError('Circular reference ' + line.assign);
}
dependency = symbols[refname];
if(dependency) {
if(line.assign === refname) {
throw new this.SyntaxError('Circular reference ' + line.assign);
}
else {
if(parent) {
addDep(parent, parent.dependsOn, dependency, symbols);
}
else {
if(parent) {
addDep(parent, parent.dependsOn, dependency, symbols);
}
else {
addDep(line, line.dependsOn, dependency, symbols);
}
addDep(line, line.dependsOn, dependency, symbols);
}
}
var hasverb = dependency[line.type];
if(hasverb && hasverb.expect){
line.expects = hasverb.expect;

}
}else{
if(cache['_tables'] && cache['_tables'][from.name] && cache['_tables'][from.name].verbs && cache['_tables'][from.name].verbs[line.type] && cache['_tables'][from.name].verbs[line.type].expects){
line.expects = fromTable;
}
}
}
}
Expand Down

0 comments on commit e197781

Please sign in to comment.