Skip to content

Commit

Permalink
Working query building eval for examples, continue working on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Jun 3, 2014
1 parent af1f9e8 commit e989d0a
Show file tree
Hide file tree
Showing 9 changed files with 565 additions and 218 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -25,7 +25,10 @@ To suggest a feature, report a bug, or general discussion: http://github.com/tgr
#### Here's a quick demo:

```js
var knex = require('knex')({dialect: 'mysql', connection: process.env.DB_CONNECTION_STRING});
var knex = require('knex')({
dialect: 'mysql',
connection: process.env.DB_CONNECTION_STRING
});

// Create a table
knex.schema.createTable('users', function(table) {
Expand Down
3 changes: 3 additions & 0 deletions browser/knex.js
Expand Up @@ -120,6 +120,9 @@ Knex.initialize = function(config) {
if (!Clients[clientName]) {
throw new Error(clientName + ' is not a valid Knex client, did you misspell it?');
}
knex.toString = function() {
return '[object Knex:' + clientName + ']';
};
Dialect = Clients[clientName]();
client = new Dialect(config);
}
Expand Down
3 changes: 3 additions & 0 deletions browser/websql.js
Expand Up @@ -120,6 +120,9 @@ Knex.initialize = function(config) {
if (!Clients[clientName]) {
throw new Error(clientName + ' is not a valid Knex client, did you misspell it?');
}
knex.toString = function() {
return '[object Knex:' + clientName + ']';
};
Dialect = Clients[clientName]();
client = new Dialect(config);
}
Expand Down
6 changes: 6 additions & 0 deletions docs/assets/style.css
Expand Up @@ -167,4 +167,10 @@ ul {
pre {
overflow: scroll;
}
}
div.language {
position: fixed;
top: 0;
right: 0;
padding: 5px;
}
15 changes: 11 additions & 4 deletions gulpfile.js
Expand Up @@ -72,6 +72,12 @@ function buildKnex() {
});
}

function buildWebSQL() {
argv.t = 'websql';
argv.o = argv.o || 'websql.js';
buildKnex();
}

function buildDependencies() {
var b = browserify();
var depStream = fs.createWriteStream('./browser/deps.js');
Expand All @@ -82,12 +88,13 @@ function buildDependencies() {
});
}

gulp.task('build', buildKnex);
gulp.task('build:websql', function() {
argv.t = 'websql';
argv.o = argv.o || 'websql.js';
gulp.task('build', function() {
buildKnex();
buildWebSQL();
buildDependencies();
});
gulp.task('build:knex', buildKnex);
gulp.task('build:websql', buildWebSQL);
gulp.task('build:deps', buildDependencies);

// Run the test... TODO: split these out to individual components.
Expand Down

0 comments on commit e989d0a

Please sign in to comment.