New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

js-data-sql

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-data-sql - npm Package Compare versions

Comparing version 0.11.17 to 1.0.0-beta.1

AUTHORS

28

CHANGELOG.md

@@ -0,1 +1,29 @@

##### 1.0.0-beta.1 - 14 May 2016
Official v1 beta release
###### Breaking changes
- `SqlAdapter#query` has been renamed to `SqlAdapter#knex`
- Options passed to `new SqlAdapter` are no longer passed directly to `knex(options)`, instead `knex` options must be nested under a `knexOptions` field in the `options` object passed to `new SqlAdapter`, so as to separate `knex` options from adapter options.
- Now depends on js-data v3, no longer works with js-data v2
- The signature for the `filterQuery` method has been changed. `filterQuery` no longer performs any select, but only as `where` modifier to an existing sqlBuilder instance that must be passed as the first argument to `filterQuery`.
- Now you must import like this:
```js
// CommonJS
var JSDataSql = require('js-data-sql')
var SqlAdapter = JSDataSql.SqlAdapter
var adapter = new SqlAdapter({...})
```
```js
// ES2015 modules
import {SqlAdapter} from 'js-data-sql'
const adapter = new SqlAdapter({...})
```
- `SqlAdapter` now extends the base `Adapter` class, which does the heavy lifting for
eager-loading relations and adds a multitude of lifecycle hook methods.
##### 0.11.2 - 19 October 2015

@@ -2,0 +30,0 @@

84

package.json
{
"name": "js-data-sql",
"description": "Postgres/MySQL/MariaDB/SQLite3 adapter for js-data.",
"version": "0.11.17",
"homepage": "http://www.js-data.io/docs/dssqladapter",
"version": "1.0.0-beta.1",
"homepage": "https://github.com/js-data/js-data-sql",
"repository": {

@@ -10,8 +10,12 @@ "type": "git",

},
"author": {
"name": "Jason Dobry",
"email": "jason.dobry@gmail.com"
},
"author": "js-data-sql project authors",
"license": "MIT",
"main": "./dist/js-data-sql.js",
"typings": "./dist/js-data-sql.d.ts",
"files": [
"dist/",
"src/",
"AUTHORS",
"CONTRIBUTORS"
],
"keywords": [

@@ -29,12 +33,34 @@ "data",

],
"standard": {
"parser": "babel-eslint",
"globals": [
"describe",
"it",
"sinon",
"assert",
"before",
"after",
"beforeEach",
"afterEach"
],
"ignore": ["dist/", "test/"]
},
"babel": {
"presets": ["es2015-rollup"]
},
"scripts": {
"lint": "standard src/index.js",
"build": "webpack --config webpack.config.js --progress --colors",
"mocha-mysql": "DB_CLIENT=mysql DB_USER=root mocha --timeout 20000 --reporter dot mocha.start.js test/*.spec.js",
"mocha-pg": "DB_CLIENT=pg mocha --timeout 20000 --reporter dot mocha.start.js test/*.spec.js",
"lint": "repo-tools lint \"**/*.js\"",
"bundle": "rollup -c rollup.config.js -f cjs -o dist/js-data-sql.js -m dist/js-data-sql.js.map src/index.js && repo-tools write-version dist/js-data-sql.js",
"doc": "jsdoc -c conf.json src node_modules/js-data-adapter/src",
"watch": "watch \"npm run bundle\" src/",
"build": "npm run lint && npm run bundle",
"mocha-sqlite3": "DB_CLIENT=sqlite3 DB_FILE=\"./test.db\" mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
"mocha-mysql": "DB_CLIENT=mysql DB_USER=root mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
"mocha-pg": "DB_CLIENT=pg mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
"mocha-all": "npm run mocha-mysql && npm run mocha-pg",
"cover": "istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- --timeout 20000 --reporter dot mocha.start.js test/*.spec.js",
"cover": "DB_CLIENT=mysql DB_USER=root istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- -t 30000 -R dot -r source-map-support/register mocha.start.js",
"test": "npm run lint && npm run build && npm run cover",
"ci": "npm run test && cat coverage/lcov.info | coveralls || true && cat ./coverage/lcov.info | codacy-coverage || true",
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors",
"ci": "npm run test && cat coverage/lcov.info | codecov",
"create-migration": "knex --cwd=test migrate:make",

@@ -44,29 +70,21 @@ "migrate-db": "knex --cwd=test migrate:latest",

},
"standard": {
"parser": "babel-eslint"
},
"dependencies": {
"mout": "0.11.1"
"js-data-adapter": "~0.6.2",
"mout": "1.0.0"
},
"peerDependencies": {
"js-data": "~2.x",
"js-data": "^3.0.0-beta.5",
"knex": ">=0.7.4"
},
"devDependencies": {
"babel-core": "6.1.4",
"babel-eslint": "4.1.5",
"babel-loader": "6.1.0",
"babel-preset-es2015": "6.1.2",
"bluebird": "2.10.2",
"chai": "3.4.1",
"co": "4.6.0",
"co-mocha": "1.1.2",
"codacy-coverage": "1.1.3",
"coveralls": "2.11.4",
"istanbul": "0.4.0",
"js-data-adapter-tests": "~1.x",
"mocha": "2.3.3",
"standard": "5.3.1",
"webpack": "1.12.2"
"babel-polyfill": "6.8.0",
"babel-preset-es2015-rollup": "1.1.1",
"istanbul": "0.4.3",
"js-data-adapter-tests": "^2.0.0-alpha.20",
"js-data-repo-tools": "0.5.1",
"rollup": "0.26.3",
"rollup-plugin-babel": "2.4.0",
"source-map-support": "0.4.0",
"watch": "0.18.0"
}
}

@@ -1,159 +0,35 @@

<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" />
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="96" height="96" />
## js-data-sql [![Slack Status][sl_b]][sl_l] [![npm version][npm_b]][npm_l] [![Circle CI][circle_b]][circle_l] [![npm downloads][dn_b]][dn_l] [![Coverage Status][cov_b]][cov_l] [![Codacy][cod_b]][cod_l]
# js-data-sql
[![Slack Status][sl_b]][sl_l]
[![npm version][npm_b]][npm_l]
[![Circle CI][circle_b]][circle_l]
[![npm downloads][dn_b]][dn_l]
[![Coverage Status][cov_b]][cov_l]
Postgres/MySQL/MariaDB/SQLite3 adapter for [js-data](http://www.js-data.io/).
### API Documentation
[DSSqlAdapter](http://www.js-data.io/docs/dssqladapter)
To get started, visit __[http://js-data.io](http://www.js-data.io/docs/js-data-sql)__.
### Quick Start
`npm install --save knex js-data js-data-sql`.
## Links
You also need to install the driver for the database you want to connect to.
* [Quick start](http://www.js-data.io/docs/home#quick-start) - Get started in 5 minutes
* [Guides and Tutorials](http://www.js-data.io/docs/home) - Learn how to use JSData
* [`SqlAdapter` Guide](http://www.js-data.io/docs/js-data-sql) - Learn how to use `SqlAdapter`
* [API Reference Docs](http://api.js-data.io) - Explore components, methods, options, etc.
* [Community & Support](http://js-data.io/docs/community) - Find solutions and chat with the community
* [General Contributing Guide](http://js-data.io/docs/contributing) - Give back and move the project forward
* [Contributing to js-data-sql](https://github.com/js-data/js-data-sql/blob/master/.github/CONTRIBUTING.md)
`npm install --save <mysql|mariasql|pg|sqlite3>`
## License
```js
var JSData = require('js-data');
var DSSqlAdapter = require('js-data-sql');
var store = new JSData.DS();
var adapter = new DSSqlAdapter({
client: 'mysql', // or "pg" or "sqlite3"
connection: {
host: '123.45.67.890',
user: 'ubuntu',
password: 'welcome1234'
}
});
store.registerAdapter('sql', adapter, { default: true });
// "store" will now use the Sql adapter for all async operations
```
Read about using [JSData on the Server](http://www.js-data.io/docs/jsdata-on-the-server).
### Changelog
[CHANGELOG.md](https://github.com/js-data/js-data-sql/blob/master/CHANGELOG.md)
### Community
- [Slack Channel](http://slack.js-data.io) - Better than IRC!
- [Announcements](http://www.js-data.io/blog)
- [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions!
- [Issues](https://github.com/js-data/js-data-sql/issues) - Found a bug? Feature request? Submit an issue!
- [GitHub](https://github.com/js-data/js-data-sql) - View the source code for js-data.
- [Contributing Guide](https://github.com/js-data/js-data-sql/blob/master/CONTRIBUTING.md)
### Contributing
First, support is handled via the [Slack Channel](http://slack.js-data.io) and
the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions
there.
When submitting issues on GitHub, please include as much detail as possible to
make debugging quick and easy.
- good - Your versions of js-data, js-data-sql, etc., relevant console
logs/error, code examples that revealed the issue
- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or
[bin](http://jsbin.com/?html,output) that demonstrates the issue
- best - A Pull Request that fixes the issue, including test coverage for the
issue and the fix
[Github Issues](https://github.com/js-data/js-data-sql/issues).
#### Submitting Pull Requests
1. Contribute to the issue/discussion that is the reason you'll be developing in
the first place
1. Fork js-data-sql
1. `git clone git@github.com:<you>/js-data-sql.git`
1. `cd js-data-sql; npm install;`
1. Write your code, including relevant documentation and tests
1. Run `npm test` (build and test)
- You need Node 4.x that includes generator support without a flag
- The tests expect a database to be running as follows, but can be overridden by passing the applicable environment variable as indicated (ex. `DB_HOST=192.168.99.100 npm test`).
- `DB_HOST`: `localhost`
- `DB_NAME`: `circle_test`
- `DB_USER`: `ubuntu`
- You may use `docker`/`docker-compose` to create MySql and Postgres containers to test against
- `docker-compose up -d`
- Start containers named `js-data-sql-mysql` and `js-data-sql-pg`
- MySQL
- Environment variables
- `DB_CLIENT` = `mysql`
- `DB_USER` = `root`
- `DB_HOST` = `IP of docker-machine if not localhost`
- Populate schema
- `DB_CLIENT=mysql DB_USER=root npm run migrate-db`
- Also set `DB_HOST` if different from `localhost`
- Run tests
- `npm run mocha-mysql`
- Set `DB_HOST` if different from `localhost`
- Run cli
- `docker exec -it js-data-sql-mysql mysql circle_test`
- Postgres
- Environment variables
- `DB_CLIENT` = `pg`
- `DB_USER` = `ubuntu`
- `DB_HOST` = `IP of docker-machine if not localhost`
- Populate schema
- `DB_CLIENT=pg npm run migrate-db`
- Also set `DB_HOST` if different from `localhost`
- Run tests
- `npm run mocha-pg`
- Also set `DB_HOST` if different from `localhost`
- `docker exec -it js-data-sql-pg psql -U ubuntu -d circle_test`
- Run cli
- All databases
- Run all tests against MySQL and Postgres
- `npm run mocha-all`
- Also set `DB_HOST` if different from `localhost`
1. Your code will be linted and checked for formatting, the tests will be run
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They
will be committed when a release is cut.
1. Submit your PR and we'll review!
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!)
### License
The MIT License (MIT)
Copyright (c) 2014-2015 Jason Dobry
Copyright (c) 2014-2016 js-data-sql project authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
* [LICENSE](https://github.com/js-data/js-data-sql/blob/master/LICENSE)
* [AUTHORS](https://github.com/js-data/js-data-sql/blob/master/AUTHORS)
* [CONTRIBUTORS](https://github.com/js-data/js-data-sql/blob/master/CONTRIBUTORS)
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[sl_b]: http://slack.js-data.io/badge.svg

@@ -163,9 +39,7 @@ [sl_l]: http://slack.js-data.io

[npm_l]: https://www.npmjs.org/package/js-data-sql
[circle_b]: https://img.shields.io/circleci/project/js-data/js-data-sql/master.svg?style=flat
[circle_l]: https://circleci.com/gh/js-data/js-data-sql/tree/master
[circle_b]: https://img.shields.io/circleci/project/js-data/js-data-sql.svg?style=flat
[circle_l]: https://circleci.com/gh/js-data/js-data-sql
[dn_b]: https://img.shields.io/npm/dm/js-data-sql.svg?style=flat
[dn_l]: https://www.npmjs.org/package/js-data-sql
[cov_b]: https://img.shields.io/coveralls/js-data/js-data-sql/master.svg?style=flat
[cov_l]: https://coveralls.io/github/js-data/js-data-sql?branch=master
[cod_b]: https://img.shields.io/codacy/307c2e9399394fdaa5354cda7329516d.svg
[cod_l]: https://www.codacy.com/app/jasondobry/js-data-sql/dashboard
[cov_b]: https://img.shields.io/codecov/c/github/js-data/js-data-sql.svg?style=flat
[cov_l]: https://codecov.io/github/js-data/js-data-sql

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc