mirror of
https://github.com/knex/knex.git
synced 2025-06-26 22:00:25 +00:00
Working query building eval for examples, continue working on docs
This commit is contained in:
parent
af1f9e83ae
commit
e989d0a46e
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -167,4 +167,10 @@ ul {
|
||||
pre {
|
||||
overflow: scroll;
|
||||
}
|
||||
}
|
||||
div.language {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 5px;
|
||||
}
|
15
gulpfile.js
15
gulpfile.js
@ -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.
|
||||
|
769
index.html
769
index.html
File diff suppressed because it is too large
Load Diff
3
knex.js
3
knex.js
@ -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);
|
||||
}
|
||||
|
@ -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": {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user