Skip to content

Commit ab46700

Browse files
authored
js-data v3 js-data-sql v1 (#69)
1 parent 92d0c88 commit ab46700

30 files changed

+14068
-11381
lines changed

.babelrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
"es2015"
4+
],
5+
"plugins": [
6+
"syntax-async-functions",
7+
"transform-regenerator"
8+
]
9+
}

.github/CONTRIBUTING.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Contributing to js-data-sql
2+
3+
[Read the general Contributing Guide](http://js-data.io/docs/contributing).
4+
5+
## Project structure
6+
7+
* `dist/` - Contains final build files for distribution
8+
* `doc/` - Output folder for JSDocs
9+
* `src/` - Project source code
10+
* `test/` - Project tests
11+
12+
## Clone, build & test
13+
14+
1. `clone [email protected]:js-data/js-data-sql.git`
15+
1. `cd js-data-sql`
16+
1. `npm install`
17+
1. `npm run build` - Lint and build distribution files
18+
1. `npm run mocha` - Run tests (A compatible sql server must be running)
19+
20+
#### Submitting Pull Requests
21+
22+
1. Contribute to the issue/discussion that is the reason you'll be developing in
23+
the first place
24+
1. Fork js-data-sql
25+
1. `git clone [email protected]:<you>/js-data-sql.git`
26+
1. `cd js-data-sql; npm install;`
27+
1. Write your code, including relevant documentation and tests
28+
1. Run `npm test` (build and test)
29+
- You need Node 4.x that includes generator support without a flag
30+
- 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`).
31+
- `DB_HOST`: `localhost`
32+
- `DB_NAME`: `circle_test`
33+
- `DB_USER`: `ubuntu`
34+
- You may use `docker`/`docker-compose` to create MySql and Postgres containers to test against
35+
- `docker-compose up -d`
36+
- Start containers named `js-data-sql-mysql` and `js-data-sql-pg`
37+
- MySQL
38+
- Environment variables
39+
- `DB_CLIENT` = `mysql`
40+
- `DB_USER` = `root`
41+
- `DB_HOST` = `IP of docker-machine if not localhost`
42+
- Populate schema
43+
- `DB_CLIENT=mysql DB_USER=root npm run migrate-db`
44+
- Also set `DB_HOST` if different from `localhost`
45+
- Run tests
46+
- `npm run mocha-mysql`
47+
- Set `DB_HOST` if different from `localhost`
48+
- Run cli
49+
- `docker exec -it js-data-sql-mysql mysql circle_test`
50+
- Postgres
51+
- Environment variables
52+
- `DB_CLIENT` = `pg`
53+
- `DB_USER` = `ubuntu`
54+
- `DB_HOST` = `IP of docker-machine if not localhost`
55+
- Populate schema
56+
- `DB_CLIENT=pg npm run migrate-db`
57+
- Also set `DB_HOST` if different from `localhost`
58+
- Run tests
59+
- `npm run mocha-pg`
60+
- Also set `DB_HOST` if different from `localhost`
61+
- `docker exec -it js-data-sql-pg psql -U ubuntu -d circle_test`
62+
- Run cli
63+
- All databases
64+
- Run all tests against MySQL and Postgres
65+
- `npm run mocha-all`
66+
- Also set `DB_HOST` if different from `localhost`
67+
68+
1. Your code will be linted and checked for formatting, the tests will be run
69+
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They
70+
will be committed when a release is cut.
71+
1. Submit your PR and we'll review!
72+
1. Thanks!
73+
74+
## To cut a release
75+
76+
1. Checkout master
77+
1. Bump version in `package.json` appropriately
78+
1. Update `CHANGELOG.md` appropriately
79+
1. Run `npm run release`
80+
1. Commit and push changes
81+
1. Checkout `release`, merge `master` into `release`
82+
1. Run `npm run release` again
83+
1. Commit and push changes
84+
1. Make a GitHub release
85+
- tag from `release` branch
86+
- set tag name to version
87+
- set release name to version
88+
- set release body to changelog entry for the version
89+
1. `npm publish .`
90+
91+
See also [Community & Support](http://js-data.io/docs/community).

.github/ISSUE_TEMPLATE.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(delete this line) Find out how to get help here: http://js-data.io/docs/community.
2+
3+
<your detailed, actionable, and helpful text goes here>
4+
5+
Thanks!

.github/PULL_REQUEST_TEMPLATE.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for discussion)
2+
3+
- [ ] - `npm test` succeeds
4+
- [ ] - Code coverage does not decrease (if any source code was changed)
5+
- [ ] - Appropriate JSDoc comments were updated in source code (if applicable)
6+
- [ ] - Approprate changes to js-data.io docs have been suggested ("Suggest Edits" button)

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ node_modules
2929

3030
.idea/
3131
*.iml
32-
coverage/
32+
coverage/
33+
.open
34+
doc/
35+
*.db
36+
37+
.nyc_output/
38+
dist/*.js
39+
dist/*.map

.npmignore

-36
This file was deleted.

AUTHORS

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the official list of js-data-sql project authors.
2+
#
3+
# Names are formatted as:
4+
# # commits Name or Organization <email address>
5+
# The email address is not required for organizations.
6+
Andy Vanbutsele <[email protected]>
7+
Jason Dobry <[email protected]>
8+
Jason Dobry <[email protected]>
9+
Mike Eldridge <[email protected]>
10+
Mike Eldridge <[email protected]>
11+
Nathan Vecchiarelli <[email protected]>
12+
13+
Sean Lynch <[email protected]>
14+
Simon Williams <[email protected]>

CHANGELOG.md

+45
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
##### 1.0.0 - 17 August 2017
2+
3+
Stable 1.0.0 release
4+
5+
##### 1.0.0-beta.3 - 16 May 2016
6+
7+
###### Bug fixes
8+
- Small fix for filterQuery
9+
10+
##### 1.0.0-beta.2 - 16 May 2016
11+
12+
###### Breaking changes
13+
- Renamed `knexOptions` to `knexOpts` to be consistent with other adapters.
14+
15+
###### Backwards compatible changes
16+
- Added support for grouped where clauses
17+
18+
##### 1.0.0-beta.1 - 14 May 2016
19+
20+
Official v1 beta release
21+
22+
###### Breaking changes
23+
24+
- `SqlAdapter#query` has been renamed to `SqlAdapter#knex`
25+
- 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.
26+
- Now depends on js-data v3, no longer works with js-data v2
27+
- 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`.
28+
- Now you must import like this:
29+
30+
```js
31+
// CommonJS
32+
var JSDataSql = require('js-data-sql')
33+
var SqlAdapter = JSDataSql.SqlAdapter
34+
var adapter = new SqlAdapter({...})
35+
```
36+
37+
```js
38+
// ES2015 modules
39+
import {SqlAdapter} from 'js-data-sql'
40+
const adapter = new SqlAdapter({...})
41+
```
42+
43+
- `SqlAdapter` now extends the base `Adapter` class, which does the heavy lifting for
44+
eager-loading relations and adds a multitude of lifecycle hook methods.
45+
146
##### 0.11.2 - 19 October 2015
247

348
- Fixed build

CONTRIBUTING.md

-50
This file was deleted.

CONTRIBUTORS

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# People who have contributed to the js-data-sql project.
2+
#
3+
# Names should be added to this file as:
4+
# [commit count] Name <email address>
5+
2 Andy Vanbutsele <[email protected]>
6+
44 Jason Dobry <[email protected]>
7+
19 Jason Dobry <[email protected]>
8+
3 Mike Eldridge <[email protected]>
9+
2 Mike Eldridge <[email protected]>
10+
1 Nathan Vecchiarelli <[email protected]>
11+
1 Robert P <[email protected]>
12+
69 Sean Lynch <[email protected]>
13+
1 Simon Williams <[email protected]>

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2015 Jason Dobry
3+
Copyright (c) 2014-2017 js-data-sql project authors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)