Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sequelize/sequelize
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3d2df28e9fcfc6a640dbad21b0435ed8804602d4
Choose a base ref
...
head repository: sequelize/sequelize
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 901bceb444080be6eda864b4c733fa23edf1595e
Choose a head ref
Loading
Showing 389 changed files with 54,753 additions and 40,137 deletions.
22 changes: 17 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -30,12 +30,15 @@
"new-cap": [
"error",
{
"capIsNewExceptionPattern": "^BigInt",
"properties": false
}
],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"space-before-function-paren": ["error", {
"named": "never",
"anonymous": "never",
"asyncArrow": "always"
}],
"space-before-blocks": "error",
"space-infix-ops": "error",
"no-multi-spaces": "error",
@@ -91,16 +94,25 @@
"no-unused-expressions": "error",
"no-sequences": "error",
"no-self-compare": "error",
"no-case-declarations": "off"
"no-case-declarations": "off",
"prefer-object-spread": "error"
},
"settings": {
"jsdoc": {
"tagNamePreference": {
"augments": "extends"
}
}
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 2020,
"sourceType": "script"
},
"plugins": ["mocha", "jsdoc"],
"env": {
"node": true,
"mocha": true,
"es6": true
"es6": true,
"es2020": true
}
}
14 changes: 9 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

<!--
@@ -13,37 +12,42 @@ Please note this is an issue tracker, not a support forum.
For general questions, please use StackOverflow or Slack.
-->

## Issue Description
## Feature Description

### Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Example: I'm always frustrated when [...]

### Describe the solution you'd like

A clear and concise description of what you want to happen. How can the requested feature be used to approach the problem it's supposed to solve?

```js
// If applicable, add a code snippet showing how your feature would be used in a real use-case
```

### Why should this be in Sequelize

Short explanation why this should be part of Sequelize rather than a separate package.

### Describe alternatives/workarounds you've considered

A clear and concise description of any alternative solutions or features you've considered. If any workaround exists to the best of your knowledge, include it here.

### Additional context

Add any other context or screenshots about the feature request here.

## Issue Template Checklist
## Feature Request Checklist

<!-- Please answer the questions below. If you don't, your issue may be closed. -->

### Is this issue dialect-specific?
### Is this feature dialect-specific?

- [ ] No. This issue is relevant to Sequelize as a whole.
- [ ] Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ

### Would you be willing to resolve this issue by submitting a Pull Request?
### Would you be willing to implement this feature by submitting a Pull Request?

<!-- Remember that first contributors are welcome! -->

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ docs/api/tmp.md
ssce.js
sscce.js
*.sublime*
package-lock.json
yarn.lock

.nyc_output
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

45 changes: 19 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,15 +6,13 @@ language: node_js
branches:
only:
- master
- /^greenkeeper/.*$/
except:
- /^v\d+\.\d+\.\d+$/

cache: npm

install:
- npm install -g npm@latest
- npm install
- npm ci
- |-
if [ "$DIALECT" = "postgres-native" ]; then npm install pg-native; fi
@@ -28,61 +26,56 @@ env:

before_script:
# setup docker
- "if [ $MARIADB_VER ]; then export MARIADB_ENTRYPOINT=$TRAVIS_BUILD_DIR/test/config/mariadb; fi"
- "if [ $MYSQL_VER ]; then export MYSQLDB_ENTRYPOINT=$TRAVIS_BUILD_DIR/test/config/mysql; fi"
- "if [ $POSTGRES_VER ] || [ $MARIADB_VER ] || [ $MYSQL_VER ]; then docker-compose up -d ${POSTGRES_VER} ${MARIADB_VER} ${MYSQL_VER}; fi"
- "if [ $MARIADB_VER ]; then docker run --link ${MARIADB_VER}:db -e CHECK_PORT=3306 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"
- "if [ $MYSQL_VER ]; then docker run --link ${MYSQL_VER}:db -e CHECK_PORT=3306 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"
- "if [ $POSTGRES_VER ]; then docker run --link ${POSTGRES_VER}:db -e CHECK_PORT=5432 -e CHECK_HOST=db --net sequelize_default giorgos/takis; fi"
- if [ $MARIADB_VER ]; then export MARIADB_ENTRYPOINT=$TRAVIS_BUILD_DIR/test/config/mariadb; fi
- if [ $MYSQL_VER ]; then export MYSQLDB_ENTRYPOINT=$TRAVIS_BUILD_DIR/test/config/mysql; fi
- if [ $POSTGRES_VER ] || [ $MARIADB_VER ] || [ $MYSQL_VER ]; then docker-compose up -d ${POSTGRES_VER} ${MARIADB_VER} ${MYSQL_VER}; fi
- wait_for() { docker run --net sequelize_default jwilder/dockerize -timeout 2m -wait "$1"; }
- if [ $POSTGRES_VER ]; then wait_for tcp://${POSTGRES_VER}:5432; fi
- if [ $MARIADB_VER ]; then wait_for tcp://${MARIADB_VER}:3306; fi
- if [ $MYSQL_VER ]; then wait_for tcp://${MYSQL_VER}:3306; fi

script:
- |-
if [ "$COVERAGE" = true ]; then npm run cover && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info; else npm run test; fi
npm run cover && bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info
jobs:
include:
- stage: lint
node_js: '8'
node_js: '10'
script:
- npm run lint
- npm run lint-docs
- npm run test-typings
- stage: test
node_js: '6'
node_js: '10'
env: DIALECT=sqlite
- stage: test
node_js: '6'
node_js: '10'
sudo: required
env: MARIADB_VER=mariadb-103 SEQ_MARIADB_PORT=8960 DIALECT=mariadb
- stage: test
node_js: '6'
node_js: '10'
sudo: required
env: MYSQL_VER=mysql-57 SEQ_MYSQL_PORT=8980 DIALECT=mysql
- stage: test
node_js: '6'
node_js: '10'
sudo: required
env: POSTGRES_VER=postgres-10 SEQ_PG_PORT=8991 DIALECT=postgres
- stage: test
node_js: '6'
node_js: '10'
sudo: required
env: POSTGRES_VER=postgres-10 SEQ_PG_PORT=8991 SEQ_PG_MINIFY_ALIASES=1 DIALECT=postgres
script:
- npm run test-integration
- stage: test
node_js: '6'
node_js: '10'
sudo: required
env: POSTGRES_VER=postgres-95 SEQ_PG_PORT=8990 DIALECT=postgres-native
- stage: release
node_js: '8'
node_js: '10'
script:
- npm run semantic-release
before_deploy:
- npm run docs
deploy:
provider: surge
project: ./esdoc/
domain: docs.sequelizejs.com
skip_cleanup: true
- npm run lint
#- npm run semantic-release

stages:
- lint
7 changes: 0 additions & 7 deletions CONTACT.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,3 @@ You can use the information below to contact maintainers directly. We will try t

- **Jan Aagaard Meier** janzeh@gmail.com
- **Sushant Dhiman** sushantdhiman@outlook.com

### Via Slack

Maintainer's usernames for [Sequelize Slack Channel](https://sequelize.slack.com)

- **Jan Aagaard Meier** @janmeier
- **Sushant Dhiman** @sushantdhiman
6 changes: 3 additions & 3 deletions CONTRIBUTING.DOCS.md
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@

The sequelize documentation is divided in two parts:

* Tutorials, guides, and example based documentation are written in Markdown
* The API reference is generated automatically from source code comments with [ESDoc](http://esdoc.org) (which uses [JSDoc](http://usejsdoc.org) syntax).
- Tutorials, guides, and example based documentation are written in Markdown
- The API reference is generated automatically from source code comments with [ESDoc](http://esdoc.org) (which uses [JSDoc](http://usejsdoc.org) syntax).

The whole documentation is rendered using ESDoc and continuously deployed to [Surge](http://surge.sh). The output is produced in the `esdoc` folder.
The whole documentation is rendered using ESDoc and continuously deployed to Github Pages at https://sequelize.org. The output is produced in the `esdoc` folder.

The tutorials, written in markdown, are located in the `docs` folder. ESDoc is configured to find them in the `"manual"` field of `.esdoc.json`.

53 changes: 38 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
_Please note!_ The github issue tracker should only be used for feature requests and bugs with a clear description of the issue and the expected behaviour (see below). All questions belong on [Slack](https://sequelize.slack.com), [StackOverflow](https://stackoverflow.com/questions/tagged/sequelize.js) or [Google groups](https://groups.google.com/forum/#!forum/sequelize).
_Please note!_ The github issue tracker should only be used for feature requests and bugs with a clear description of the issue and the expected behaviour (see below). All questions belong on [Slack](https://sequelize.slack.com) & [StackOverflow](https://stackoverflow.com/questions/tagged/sequelize.js).

# Issues

Issues are always very welcome - after all, they are a big part of making sequelize better. However, there are a couple of things you can do to make the lives of the developers _much, much_ easier:

### Tell us:

* What you are doing?
* Post a _minimal_ code sample that reproduces the issue, including models and associations
* What do you expect to happen?
* What is actually happening?
* Which dialect you are using (postgres, mysql etc)?
* Which sequelize version you are using?
- What you are doing?
- Post a _minimal_ code sample that reproduces the issue, including models and associations
- What do you expect to happen?
- What is actually happening?
- Which dialect you are using (postgres, mysql etc)?
- Which sequelize version you are using?

When you post code, please use [Github flavored markdown](https://help.github.com/articles/github-flavored-markdown), in order to get proper syntax highlighting!

If you can even provide a pull request with a failing unit test, we will love you long time! Plus your issue will likely be fixed much faster.

# Pull requests

We're glad to get pull request if any functionality is missing or something is buggy. However, there are a couple of things you can do to make life easier for the maintainers:

* Explain the issue that your PR is solving - or link to an existing issue
* Make sure that all existing tests pass
* Make sure you followed [coding guidelines](https://github.com/sequelize/sequelize/blob/master/CONTRIBUTING.md#coding-guidelines)
* Add some tests for your new functionality or a test exhibiting the bug you are solving. Ideally all new tests should not pass _without_ your changes.
- Use [promise style](http://bluebirdjs.com/docs/why-promises.html) in all new tests. Specifically this means:
- Explain the issue that your PR is solving - or link to an existing issue
- Make sure that all existing tests pass
- Make sure you followed [coding guidelines](https://github.com/sequelize/sequelize/blob/master/CONTRIBUTING.md#coding-guidelines)
- Add some tests for your new functionality or a test exhibiting the bug you are solving. Ideally all new tests should not pass _without_ your changes.
- Use [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) in all new tests. Specifically this means:
- don't use `EventEmitter`, `QueryChainer` or the `success`, `done` and `error` events
- don't use a done callback in your test, just return the promise chain.
- Small bugfixes and direct backports to the 4.x branch are accepted without tests.
* If you are adding to / changing the public API, remember to add API docs, in the form of [JSDoc style](http://usejsdoc.org/about-getting-started.html) comments. See [section 4a](#4a-check-the-documentation) for the specifics.
- If you are adding to / changing the public API, remember to add API docs, in the form of [JSDoc style](http://usejsdoc.org/about-getting-started.html) comments. See [section 4a](#4a-check-the-documentation) for the specifics.

Interested? Coolio! Here is how to get started:

### 1. Prepare your environment

Here comes a little surprise: You need [Node.JS](http://nodejs.org).

### 2. Install the dependencies

Just "cd" into sequelize directory and run `npm install`, see an example below:
Just "cd" into sequelize directory and run `npm ci`, see an example below:

```sh
$ cd path/to/sequelize
$ npm install
$ npm ci
```

### 3. Database
@@ -72,6 +75,7 @@ You may need to specify credentials using the environment variables `SEQ_PG_USER
For Postgres you may also need to install the `postgresql-postgis` package (an optional component of some Postgres distributions, e.g. Ubuntu). The package will be named something like: `postgresql-<pg_version_number>-postgis-<postgis_version_number>`, e.g. `postgresql-9.5-postgis-2.2`. You should be able to find the exact package name on a Debian/Ubuntu system by running the command: `apt-cache search -- -postgis`.

Create the following extensions in the test database:

```
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
@@ -91,6 +95,25 @@ Now launch the docker mysql and postgres servers with this command (you can add
$ docker-compose up postgres-95 mysql-57 mssql
```

> **_NOTE:_** If you get the following output:
>
> ```
> ...
> Creating mysql-57 ... error
>
> ERROR: for mysql-57 Cannot create container for service mysql-57: b'create .: volume name is too short, names should be at least two alphanumeric characters'
>
> ERROR: for mysql-57 Cannot create container for service mysql-57: b'create .: volume name is too short, names should be at least two alphanumeric characters'
> ERROR: Encountered errors while bringing up the project.
> ```
>
> You need to set the variables `MARIADB_ENTRYPOINT` and `MYSQLDB_ENTRYPOINT` accordingly:
>
> ```sh
> $ export MARIADB_ENTRYPOINT="$PATH_TO_PROJECT/test/config/mariadb"
> $ export MYSQLDB_ENTRYPOINT="$PATH_TO_PROJECT/test/config/mysql"
> ```
**MSSQL:** Please run `npm run setup-mssql` to create the test database.
**POSTGRES:** Sequelize uses [special](https://github.com/sushantdhiman/sequelize-postgres) Docker image for PostgreSQL, which install all the extensions required by tests.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:6
FROM node:10

RUN apt-get install libpq-dev

10 changes: 10 additions & 0 deletions ENGINE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Database Engine Support

## v6-beta
| Engine | Minimum supported version |
| :------------: | :------------: |
| Postgre | [9.5 ](https://www.postgresql.org/docs/9.5/ ) |
| MySQL | [5.7](https://dev.mysql.com/doc/refman/5.7/en/) |
| MariaDB | [10.1](https://mariadb.com/kb/en/changes-improvements-in-mariadb-101/) |
| Microsoft SQL | `12.0.2000` |
| SQLite | [3.0](https://www.sqlite.org/version3.html)
Loading