Working query building eval for examples, continue working on docs

This commit is contained in:
Tim Griesser 2014-06-03 01:37:19 -04:00
parent af1f9e83ae
commit e989d0a46e
9 changed files with 577 additions and 230 deletions

View File

@ -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) {

View File

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

View File

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

View File

@ -167,4 +167,10 @@ ul {
pre {
overflow: scroll;
}
}
div.language {
position: fixed;
top: 0;
right: 0;
padding: 5px;
}

View File

@ -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');
@ -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.

File diff suppressed because it is too large Load Diff

View File

@ -119,6 +119,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);
}

View File

@ -1,6 +1,6 @@
{
"name": "knex",
"version": "0.5.14",
"version": "0.6.0",
"description": "A batteries-included SQL query & schema builder for Postgres, MySQL and SQLite3 and the Browser",
"main": "knex.js",
"directories": {

View File

@ -1,7 +1,6 @@
module.exports = function(testSuite) {
var _ = require('lodash');
var isDev = parseInt(process.env.KNEX_DEV, 10);
// This is where all of the info from the query calls goes...
return {