js-data-sql
Advanced tools
Comparing version 0.11.2 to 0.11.3
@@ -26,1 +26,15 @@ # Contributing Guide | ||
1. Thanks! | ||
#### Have write access? | ||
Here's how to make a release on the `master` branch: | ||
1. Bump `package.json` to the appropriate version. | ||
1. `npm test` must succeed. | ||
1. This time, the built `dist/js-data-sql.js` file _will_ be committed, so stage its changes. | ||
1. Mention the release version in the commit message, e.g. `Stable Version 1.2.3` | ||
1. Push to master. | ||
1. Create a git tag. Name it the version of the release, e.g. `1.2.3` | ||
- Easiest way is to just create a GitHub Release, which will create the tag for you. Name the Release and the git tag the same thing. | ||
1. `git fetch origin` if you tagged it via GitHub Release, so you can get the tag on your local machine. | ||
1. `npm publish .` (Make sure you got the version bumped correctly!) |
@@ -56,6 +56,6 @@ module.exports = | ||
var knex = __webpack_require__(1); | ||
var JSData = __webpack_require__(2); | ||
var map = __webpack_require__(3); | ||
var underscore = __webpack_require__(4); | ||
var knex = __webpack_require__(2); | ||
var JSData = __webpack_require__(3); | ||
var map = __webpack_require__(4); | ||
var underscore = __webpack_require__(1); | ||
var unique = __webpack_require__(5); | ||
@@ -127,10 +127,14 @@ var toString = __webpack_require__(6); | ||
var _table = getTable(localResourceConfig); | ||
var localId = _table + '.' + relation.localKey; | ||
if (relation) { | ||
var _table = getTable(localResourceConfig); | ||
var localId = _table + '.' + relation.localKey; | ||
var relationTable = getTable(relationResourceConfig); | ||
var foreignId = relationTable + '.' + relationResourceConfig.idAttribute; | ||
var relationTable = getTable(relationResourceConfig); | ||
var foreignId = relationTable + '.' + relationResourceConfig.idAttribute; | ||
query = query.join(relationTable, localId, foreignId); | ||
joinedTables.push(relationPath.join('.')); | ||
query = query.join(relationTable, localId, foreignId); | ||
joinedTables.push(relationPath.join('.')); | ||
} else { | ||
// local column | ||
} | ||
} | ||
@@ -476,3 +480,3 @@ localResourceConfig = relationResourceConfig; | ||
module.exports = require("knex"); | ||
module.exports = require("mout/string/underscore"); | ||
@@ -483,3 +487,3 @@ /***/ }, | ||
module.exports = require("js-data"); | ||
module.exports = require("knex"); | ||
@@ -490,3 +494,3 @@ /***/ }, | ||
module.exports = require("mout/array/map"); | ||
module.exports = require("js-data"); | ||
@@ -497,3 +501,3 @@ /***/ }, | ||
module.exports = require("mout/string/underscore"); | ||
module.exports = require("mout/array/map"); | ||
@@ -500,0 +504,0 @@ /***/ }, |
@@ -61,4 +61,5 @@ /*global assert:true */ | ||
connection: { | ||
user: process.env.C9_USER || 'ubuntu', | ||
database: process.env.C9_USER ? 'c9' : 'circle_test' | ||
host: process.env.DB_HOST || 'localhost', | ||
user: process.env.DB_USER || process.env.C9_USER || 'ubuntu', | ||
database: process.env.DB_NAME || (process.env.C9_USER ? 'c9' : 'circle_test') | ||
//user: 'root', | ||
@@ -65,0 +66,0 @@ //database: 'test' |
{ | ||
"name": "js-data-sql", | ||
"description": "Postgres/MySQL/MariaDB/SQLite3 adapter for js-data.", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"homepage": "http://www.js-data.io/docs/dssqladapter", | ||
@@ -42,3 +42,3 @@ "repository": { | ||
"build": "node_modules/webpack/bin/webpack.js --config webpack.config.js --progress --colors", | ||
"mocha": "mocha test/*.spec.js --timeout 20000 --reporter spec", | ||
"mocha": "mocha --timeout 20000 --reporter spec mocha.start.js test/*.spec.js", | ||
"test": "npm run lint && npm run build && npm run mocha" | ||
@@ -45,0 +45,0 @@ }, |
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="64" height="64" /> | ||
## js-data-sql [![npm version](https://img.shields.io/npm/v/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-sql/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-sql/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/js-data/js-data-sql/blob/master/LICENSE) | ||
## js-data-sql [![npm version](https://img.shields.io/npm/v/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-sql/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-sql/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) | ||
@@ -10,14 +10,2 @@ Postgres/MySQL/MariaDB/SQLite3 adapter for [js-data](http://www.js-data.io/). | ||
### Project Status | ||
__Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js-data/js-data-sql.svg?style=flat-square)](https://github.com/js-data/js-data-sql/releases) | ||
__Status:__ | ||
[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-sql.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-sql) [![Codacy](https://img.shields.io/codacy/4da2bc1bbca74fd38c4532cb8bc8d40a.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-sql/dashboard) | ||
__Supported Platforms:__ | ||
[![node version](https://img.shields.io/badge/Node-0.10%2B-green.svg?style=flat-square)](https://github.com/js-data/js-data) | ||
### Quick Start | ||
@@ -49,2 +37,4 @@ `npm install --save js-data js-data-sql`. | ||
Read about using [JSData on the Server](http://www.js-data.io/docs/jsdata-on-the-server). | ||
### Changelog | ||
@@ -78,5 +68,5 @@ [CHANGELOG.md](https://github.com/js-data/js-data-sql/blob/master/CHANGELOG.md) | ||
1. `git clone git@github.com:<you>/js-data-sql.git` | ||
1. `cd js-data-sql; npm install; bower install;` | ||
1. `cd js-data-sql; npm install;` | ||
1. Write your code, including relevant documentation and tests | ||
1. Run `grunt test` (build and test) | ||
1. Run `npm test` (build and test) | ||
- You need io.js or Node 4.x that includes generator support without a flag | ||
@@ -88,2 +78,16 @@ 1. Your code will be linted and checked for formatting, the tests will be run | ||
#### Have write access? | ||
Here's how to make a release on the `master` branch: | ||
1. Bump `package.json` to the appropriate version. | ||
1. `npm test` must succeed. | ||
1. This time, the built `dist/js-data-sql.js` file _will_ be committed, so stage its changes. | ||
1. Mention the release version in the commit message, e.g. `Stable Version 1.2.3` | ||
1. Push to master. | ||
1. Create a git tag. Name it the version of the release, e.g. `1.2.3` | ||
- Easiest way is to just create a GitHub Release, which will create the tag for you. Name the Release and the git tag the same thing. | ||
1. `git fetch origin` if you tagged it via GitHub Release, so you can get the tag on your local machine. | ||
1. `npm publish .` (Make sure you got the version bumped correctly!) | ||
### License | ||
@@ -90,0 +94,0 @@ |
@@ -67,10 +67,14 @@ let knex = require('knex') | ||
let [relation] = localResourceConfig.relationList.filter(r => r.relation === relationName) | ||
let table = getTable(localResourceConfig) | ||
let localId = `${table}.${relation.localKey}` | ||
if (relation) { | ||
let table = getTable(localResourceConfig) | ||
let localId = `${table}.${relation.localKey}` | ||
let relationTable = getTable(relationResourceConfig) | ||
let foreignId = `${relationTable}.${relationResourceConfig.idAttribute}` | ||
let relationTable = getTable(relationResourceConfig) | ||
let foreignId = `${relationTable}.${relationResourceConfig.idAttribute}` | ||
query = query.join(relationTable, localId, foreignId) | ||
joinedTables.push(relationPath.join('.')) | ||
query = query.join(relationTable, localId, foreignId) | ||
joinedTables.push(relationPath.join('.')) | ||
} else { | ||
// local column | ||
} | ||
} | ||
@@ -77,0 +81,0 @@ localResourceConfig = relationResourceConfig |
@@ -185,2 +185,12 @@ var Promise = require('bluebird'); | ||
it('should filter when relations have same column if column is qualified', function* () { | ||
var profile1 = yield adapter.create(Profile, { email: 'foo@test.com' }); | ||
var user1 = yield adapter.create(User, {name: 'John', profileId: profile1.id}); | ||
// `id` column must be qualified with `user.` | ||
var users = yield adapter.findAll(User, {'user.id': user1.id, 'profile.email': 'foo@test.com'}); | ||
assert.equal(users.length, 1); | ||
assert.equal(users[0].profileId, profile1.id); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
66972
1276
112
5