Comparing version 2.0.1 to 2.1.0
156
package.json
{ | ||
"name": "knexed", | ||
"version": "2.0.1", | ||
"description": "Knex utilities", | ||
"license": "MIT", | ||
"author": "Strider <strange.transistor@gmail.com>", | ||
"repository": "StreetStrider/knexed", | ||
"keywords": | ||
[ | ||
"knex", "query-builder", "query builder", | ||
"sql", "sql-query", "query", "database", | ||
"postgresql", "sqlite3", | ||
"mysql", "mariadb", | ||
"oracle", "mssql" | ||
], | ||
"engines": | ||
{ | ||
"node": ">= 10" | ||
}, | ||
"peerDependencies": | ||
{ | ||
"knex": ">= 0.10" | ||
}, | ||
"files": | ||
[ | ||
"/catch/", | ||
"/query/", | ||
"/table/", | ||
"/tx/", | ||
"/*.js", | ||
"!.eslintrc.js" | ||
], | ||
"scripts": | ||
{ | ||
"st": "eslint *.js tx/ table/ query/ test/", | ||
"t": "flow check", | ||
"unit": "mocha --check-leaks --recursive test/**.test.js test/**/*.test.js", | ||
"cover": "nyc --reporter=lcov --reporter=text-summary npm run unit", | ||
"test": "npm run st && npm run t && npm run unit", | ||
"all": "npm test && npm run cover", | ||
"coveralls": "cat coverage/lcov.info | coveralls" | ||
}, | ||
"dependencies": | ||
{ | ||
"curry": | ||
"1", | ||
"bluebird": | ||
"3" | ||
}, | ||
"devDependencies": | ||
{ | ||
"knex": | ||
"0.16", | ||
"mocha": | ||
"3", | ||
"chai": | ||
"^3.5", | ||
"sqlite3": | ||
"4", | ||
"lodash": | ||
"^4.17.11", | ||
"flow-bin": | ||
"0.98", | ||
"eslint": | ||
"5", | ||
"js-outlander": | ||
"StrangeTransistor/js-outlander#2.5.0", | ||
"nyc": | ||
"14", | ||
"coveralls": | ||
"3" | ||
} | ||
} | ||
"name": "knexed", | ||
"version": "2.1.0", | ||
"description": "Knex utilities", | ||
"license": "MIT", | ||
"author": "Strider <strange.transistor@gmail.com>", | ||
"repository": "StreetStrider/knexed", | ||
"keywords": [ | ||
"knex", | ||
"query-builder", | ||
"query builder", | ||
"sql", | ||
"sql-query", | ||
"query", | ||
"database", | ||
"postgresql", | ||
"sqlite3", | ||
"mysql", | ||
"mariadb", | ||
"oracle", | ||
"mssql" | ||
], | ||
"engines": { | ||
"node": ">= 10" | ||
}, | ||
"peerDependencies": { | ||
"knex": ">= 0.10" | ||
}, | ||
"files": [ | ||
"/catch/", | ||
"/query/", | ||
"/table/", | ||
"/tx/", | ||
"/*.js", | ||
"!.eslintrc.js" | ||
], | ||
"scripts": { | ||
"st": "eslint *.js tx/ table/ query/ test/", | ||
"t": "flow check", | ||
"unit": "mocha --check-leaks --recursive test/**.test.js test/**/*.test.js", | ||
"cover": "nyc --reporter=lcov --reporter=text-summary npm run unit", | ||
"test": "npm run st && npm run t && npm run unit", | ||
"all": "npm test && npm run cover", | ||
"coveralls": "cat coverage/lcov.info | coveralls" | ||
}, | ||
"dependencies": { | ||
"curry": "1", | ||
"bluebird": "3" | ||
}, | ||
"devDependencies": { | ||
"knex": "0.16", | ||
"mocha": "3", | ||
"chai": "^3.5", | ||
"sqlite3": "4", | ||
"lodash": "^4.17.11", | ||
"flow-bin": "0.98", | ||
"eslint": "5", | ||
"js-outlander": "StrangeTransistor/js-outlander#2.5.0", | ||
"nyc": "14", | ||
"coveralls": "3" | ||
} | ||
} |
@@ -110,2 +110,11 @@ # knexed | ||
join([ accounts, 'A' ], [ messages, 'M' ], [ 'id', 'user_id' ]) | ||
/* | ||
* multi-stage join is possible, by passing | ||
* join as the left argument in join(). | ||
* different types of joins are supported | ||
*/ | ||
var messages_read = table(knex, 'messages_read') | ||
var messages$read = join.left(messages, messages_read, 'id') | ||
var accounts$messages$read = join(messages$read, accounts, [ 'user_id', 'id' ]) | ||
``` | ||
@@ -112,0 +121,0 @@ |
@@ -7,3 +7,3 @@ /* @flow */ | ||
type Join = TableFn | ||
type Join = Table | ||
@@ -43,3 +43,3 @@ type TableRef | ||
( | ||
left /* :TableRef */, | ||
left /* :TableRef | Join */, | ||
right /* :TableRef */, | ||
@@ -58,3 +58,3 @@ predicate /* :Predicate */ | ||
return (tx /* :Knex$Transaction$Optional<any> */) => | ||
function $join (tx /* :Knex$Transaction$Optional<any> */) | ||
{ | ||
@@ -67,2 +67,6 @@ return tableL | ||
} | ||
table_like($join, tableL.kx, asL) | ||
return $join | ||
} | ||
@@ -81,3 +85,3 @@ } | ||
return (tx /* :Knex$Transaction$Optional<any> */) => | ||
function $join (tx /* :Knex$Transaction$Optional<any> */) | ||
{ | ||
@@ -88,2 +92,6 @@ return tableL | ||
} | ||
table_like($join, tableL.kx, asL) | ||
return $join | ||
} | ||
@@ -155,1 +163,12 @@ | ||
} | ||
function table_like ($join, kx, relname) | ||
{ | ||
$join.kx = kx | ||
$join.relname = () => relname | ||
/* @flow-off */ | ||
$join.as = (...args) => $join(...args.slice(1)) | ||
/* @flow-off */ | ||
$join.toString = () => $join.relname() | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20353
505
197