Skip to content

js-data v3 js-data-sql v1 #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"es2015"
],
"plugins": [
"syntax-async-functions",
"transform-regenerator"
]
}
91 changes: 91 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing to js-data-sql

[Read the general Contributing Guide](http://js-data.io/docs/contributing).

## Project structure

* `dist/` - Contains final build files for distribution
* `doc/` - Output folder for JSDocs
* `src/` - Project source code
* `test/` - Project tests

## Clone, build & test

1. `clone [email protected]:js-data/js-data-sql.git`
1. `cd js-data-sql`
1. `npm install`
1. `npm run build` - Lint and build distribution files
1. `npm run mocha` - Run tests (A compatible sql server must be running)

#### 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 [email protected]:<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!

## To cut a release

1. Checkout master
1. Bump version in `package.json` appropriately
1. Update `CHANGELOG.md` appropriately
1. Run `npm run release`
1. Commit and push changes
1. Checkout `release`, merge `master` into `release`
1. Run `npm run release` again
1. Commit and push changes
1. Make a GitHub release
- tag from `release` branch
- set tag name to version
- set release name to version
- set release body to changelog entry for the version
1. `npm publish .`

See also [Community & Support](http://js-data.io/docs/community).
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(delete this line) Find out how to get help here: http://js-data.io/docs/community.

<your detailed, actionable, and helpful text goes here>

Thanks!
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)

- [ ] - `npm test` succeeds
- [ ] - Code coverage does not decrease (if any source code was changed)
- [ ] - Appropriate JSDoc comments were updated in source code (if applicable)
- [ ] - Approprate changes to js-data.io docs have been suggested ("Suggest Edits" button)
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,11 @@ node_modules

.idea/
*.iml
coverage/
coverage/
.open
doc/
*.db

.nyc_output/
dist/*.js
dist/*.map
36 changes: 0 additions & 36 deletions .npmignore

This file was deleted.

14 changes: 14 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is the official list of js-data-sql project authors.
#
# Names are formatted as:
# # commits Name or Organization <email address>
# The email address is not required for organizations.
Andy Vanbutsele <[email protected]>
Jason Dobry <[email protected]>
Jason Dobry <[email protected]>
Mike Eldridge <[email protected]>
Mike Eldridge <[email protected]>
Nathan Vecchiarelli <[email protected]>
Robert P <[email protected]>
Sean Lynch <[email protected]>
Simon Williams <[email protected]>
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
##### 1.0.0 - 17 August 2017

Stable 1.0.0 release

##### 1.0.0-beta.3 - 16 May 2016

###### Bug fixes
- Small fix for filterQuery

##### 1.0.0-beta.2 - 16 May 2016

###### Breaking changes
- Renamed `knexOptions` to `knexOpts` to be consistent with other adapters.

###### Backwards compatible changes
- Added support for grouped where clauses

##### 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 `knexOpts` 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

- Fixed build
Expand Down
50 changes: 0 additions & 50 deletions CONTRIBUTING.md

This file was deleted.

13 changes: 13 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# People who have contributed to the js-data-sql project.
#
# Names should be added to this file as:
# [commit count] Name <email address>
2 Andy Vanbutsele <[email protected]>
44 Jason Dobry <[email protected]>
19 Jason Dobry <[email protected]>
3 Mike Eldridge <[email protected]>
2 Mike Eldridge <[email protected]>
1 Nathan Vecchiarelli <[email protected]>
1 Robert P <[email protected]>
69 Sean Lynch <[email protected]>
1 Simon Williams <[email protected]>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2015 Jason Dobry
Copyright (c) 2014-2017 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
Expand Down
Loading