Skip to content

Commit

Permalink
Merge branch 'master' into file-list-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vanthome committed Mar 14, 2020
2 parents 6e6eca2 + b2a2134 commit 57a8ae9
Show file tree
Hide file tree
Showing 173 changed files with 26,509 additions and 9,941 deletions.
15 changes: 13 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
}
],
"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",
Expand Down Expand Up @@ -93,8 +97,15 @@
"no-self-compare": "error",
"no-case-declarations": "off"
},
"settings": {
"jsdoc": {
"tagNamePreference": {
"augments": "extends"
}
}
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 2018,
"sourceType": "script"
},
"plugins": ["mocha", "jsdoc"],
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ docs/api/tmp.md
ssce.js
sscce.js
*.sublime*
package-lock.json
yarn.lock

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

This file was deleted.

19 changes: 9 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ branches:
cache: npm

install:
- npm install -g npm@latest
- npm install
- |-
if [ "$DIALECT" = "postgres-native" ]; then npm install pg-native; fi
Expand Down Expand Up @@ -42,40 +41,40 @@ script:
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
- npm run lint-docs #change after v6 released
before_deploy:
- npm run docs
deploy:
Expand Down
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ 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.
Expand Down
47 changes: 18 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,26 @@
[![npm version](https://badgen.net/npm/v/sequelize)](https://www.npmjs.com/package/sequelize)
[![Travis Build Status](https://badgen.net/travis/sequelize/sequelize?icon=travis)](https://travis-ci.org/sequelize/sequelize)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/9l1ypgwsp5ij46m3/branch/master?svg=true)](https://ci.appveyor.com/project/sushantdhiman/sequelize/branch/master)
[![codecov](https://badgen.net/codecov/c/github/sequelize/sequelize/master?icon=codecov)](https://codecov.io/gh/sequelize/sequelize)
[![npm downloads](https://badgen.net/npm/dm/sequelize)](https://www.npmjs.com/package/sequelize)
[![codecov](https://badgen.net/codecov/c/github/sequelize/sequelize?icon=codecov)](https://codecov.io/gh/sequelize/sequelize)
[![Last commit](https://badgen.net/github/last-commit/sequelize/sequelize)](https://github.com/sequelize/sequelize)
[![Merged PRs](https://badgen.net/github/merged-prs/sequelize/sequelize)](https://github.com/sequelize/sequelize)
[![GitHub stars](https://badgen.net/github/stars/sequelize/sequelize)](https://github.com/sequelize/sequelize)
[![Slack Status](https://sequelize-slack.herokuapp.com/badge.svg)](http://sequelize-slack.herokuapp.com/)
[![node](https://badgen.net/npm/node/sequelize)](https://www.npmjs.com/package/sequelize)
[![License](https://badgen.net/github/license/sequelize/sequelize)](https://github.com/sequelize/sequelize/blob/master/LICENSE)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.

Sequelize follows [SEMVER](http://semver.org). Supports Node v6 and above to use ES6 features.
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more. Sequelize follows [Semantic Versioning](http://semver.org).

New to Sequelize? Take a look at the [Tutorials and Guides](https://sequelize.org/master). You might also be interested in the [API Reference](https://sequelize.org/master/identifiers).

## Table of Contents
- [Installation](#installation)
- [Documentation](#documentation)
- [Responsible disclosure](#responsible-disclosure)
- [Resources](#resources)
### v6-beta Release

[![npm version](https://badgen.net/npm/v/sequelize/next)](https://www.npmjs.com/package/sequelize)

`v6-beta` is now available. You can find detailed changelog [here](https://github.com/sequelize/sequelize/blob/master/docs/manual/other-topics/upgrade-to-v6.md).

## Installation

```bash
$ npm install --save sequelize # This will install v5
$ npm install --save sequelize@next # This will install v6-beta

# And one of the following:
$ npm install --save pg pg-hstore # Postgres
Expand All @@ -39,31 +33,26 @@ $ npm install --save tedious # Microsoft SQL Server
```

## Documentation
- [v5 Documentation](https://sequelize.org/master)
- [v4 Documentation](https://sequelize.org/v4)
- [v3 Documentation](https://sequelize.org/v3)
- [v6-beta Documentation](https://sequelize.org/master)
- [v5/v4/v3 Documentation](https://sequelize.org)
- [Contributing](https://github.com/sequelize/sequelize/blob/master/CONTRIBUTING.md)

## Responsible disclosure
If you have security issues to report please refer to our [Responsible Disclosure Policy](./SECURITY.md) for more details.
If you have security issues to report, please refer to our [Responsible Disclosure Policy](https://github.com/sequelize/sequelize/blob/master/SECURITY.md) for more details.

## Resources
- [Changelog](https://github.com/sequelize/sequelize/releases)
- [Slack](http://sequelize-slack.herokuapp.com/)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/sequelize.js)

### Tools
- [Sequelize CLI](https://github.com/sequelize/cli)
- [Sequelize & TypeScript](https://sequelize.org/master/manual/typescript.html)
- [CLI](https://github.com/sequelize/cli)
- [With TypeScript](https://sequelize.org/master/manual/typescript.html)
- [Enhanced TypeScript with decorators](https://github.com/RobinBuschmann/sequelize-typescript)
- [Sequelize & GraphQL](https://github.com/mickhansen/graphql-sequelize)
- [Add-ons & Plugins](https://sequelize.org/master/manual/resources.html)
- [Sequelize & CockroachDB](https://github.com/cockroachdb/sequelize-cockroachdb)

### Learning
- [Getting Started](https://sequelize.org/master/manual/getting-started)
- [Express Example](https://github.com/sequelize/express-example)
- [For GraphQL](https://github.com/mickhansen/graphql-sequelize)
- [For CockroachDB](https://github.com/cockroachdb/sequelize-cockroachdb)
- [Plugins](https://sequelize.org/master/manual/resources.html)

### Translations
- [English v3/v4/v5](https://sequelize.org) (OFFICIAL)
- [中文文档 v4/v5](https://github.com/demopark/sequelize-docs-Zh-CN) (UNOFFICIAL)
- [English](https://sequelize.org/master) (OFFICIAL)
- [中文文档](https://github.com/demopark/sequelize-docs-Zh-CN) (UNOFFICIAL)
2 changes: 0 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ The following table describes the versions of this project that are currently su

| Version | Supported |
| ------- | ------------------ |
| 3.x | :heavy_check_mark: |
| 4.x | :heavy_check_mark: |
| 5.x | :heavy_check_mark: |

## Responsible disclosure policy
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ shallow_clone: true

environment:
matrix:
- { NODE_VERSION: 6, DIALECT: mssql, COVERAGE: true }
- { NODE_VERSION: 10, DIALECT: mssql, COVERAGE: true }

install:
- ps: Install-Product node $env:NODE_VERSION x64
Expand Down
4 changes: 4 additions & 0 deletions docs/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ div.sequelize {
font-size: 17px;
}

.no-mouse {
pointer-events: none;
}

.api-reference-link {
font-weight: bold;
padding: 0 20px;
Expand Down
18 changes: 8 additions & 10 deletions docs/esdoc-config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
'use strict';

const _ = require('lodash');
const { getDeclaredManuals, checkManuals } = require('./manual-utils');

const manualGroups = require('./manual-groups.json');

const manual = {
index: './docs/index.md',
globalIndex: true,
asset: './docs/images',
files: _.flatten(_.values(manualGroups)).map(file => `./docs/manual/${file}`)
};
checkManuals();

module.exports = {
source: './lib',
Expand Down Expand Up @@ -45,7 +38,12 @@ module.exports = {
repository: 'https://github.com/sequelize/sequelize',
site: 'https://sequelize.org/master/'
},
manual
manual: {
index: './docs/index.md',
globalIndex: true,
asset: './docs/images',
files: getDeclaredManuals()
}
}
}
]
Expand Down
20 changes: 9 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
[![License](https://badgen.net/github/license/sequelize/sequelize)](https://github.com/sequelize/sequelize/blob/master/LICENSE)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.
Sequelize is a promise-based Node.js [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping) for [Postgres](https://en.wikipedia.org/wiki/PostgreSQL), [MySQL](https://en.wikipedia.org/wiki/MySQL), [MariaDB](https://en.wikipedia.org/wiki/MariaDB), [SQLite](https://en.wikipedia.org/wiki/SQLite) and [Microsoft SQL Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server). It features solid transaction support, relations, eager and lazy loading, read replication and more.

Sequelize follows [SEMVER](http://semver.org). Supports Node v6 and above to use ES6 features.
Sequelize follows [Semantic Versioning](http://semver.org) and supports Node v10 and above.

**Sequelize v5** was released on March 13, 2019. [Official TypeScript typings are now included](manual/typescript).

You are currently looking at the **Tutorials and Guides** for Sequelize. You might also be interested in the [API Reference](identifiers).
You are currently looking at the **Tutorials and Guides** for Sequelize. You might also be interested in the [API Reference](identifiers.html).

## Quick example

Expand All @@ -38,14 +36,14 @@ User.init({
birthday: DataTypes.DATE
}, { sequelize, modelName: 'user' });

sequelize.sync()
.then(() => User.create({
(async () => {
await sequelize.sync();
const jane = await User.create({
username: 'janedoe',
birthday: new Date(1980, 6, 20)
}))
.then(jane => {
console.log(jane.toJSON());
});
console.log(jane.toJSON());
})();
```

To learn more about how to use Sequelize, read the tutorials available in the left menu. Begin with [Getting Started](manual/getting-started).
To learn more about how to use Sequelize, read the tutorials available in the left menu. Begin with [Getting Started](manual/getting-started.html).
67 changes: 46 additions & 21 deletions docs/manual-groups.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
{
"Core Concepts": [
"getting-started.md",
"dialects.md",
"data-types.md",
"models-definition.md",
"models-usage.md",
"hooks.md",
"querying.md",
"instances.md",
"associations.md",
"raw-queries.md"
"core-concepts/getting-started.md",
"core-concepts/model-basics.md",
"core-concepts/model-instances.md",
"core-concepts/model-querying-basics.md",
"core-concepts/model-querying-finders.md",
"core-concepts/getters-setters-virtuals.md",
"core-concepts/validations-and-constraints.md",
"core-concepts/raw-queries.md",
"core-concepts/assocs.md",
"core-concepts/paranoid.md"
],
"Advanced Association Concepts": [
"advanced-association-concepts/eager-loading.md",
"advanced-association-concepts/creating-with-associations.md",
"advanced-association-concepts/advanced-many-to-many.md",
"advanced-association-concepts/association-scopes.md",
"advanced-association-concepts/polymorphic-associations.md"
],
"Other Topics": [
"transactions.md",
"scopes.md",
"read-replication.md",
"migrations.md",
"resources.md",
"typescript.md",
"upgrade-to-v5.md",
"legacy.md",
"whos-using.md",
"legal.md"
"other-topics/dialect-specific-things.md",
"other-topics/transactions.md",
"other-topics/hooks.md",
"other-topics/query-interface.md",
"other-topics/naming-strategies.md",
"other-topics/scopes.md",
"other-topics/sub-queries.md",
"other-topics/other-data-types.md",
"other-topics/constraints-and-circularities.md",
"other-topics/extending-data-types.md",
"other-topics/indexes.md",
"other-topics/optimistic-locking.md",
"other-topics/read-replication.md",
"other-topics/connection-pool.md",
"other-topics/legacy.md",
"other-topics/migrations.md",
"other-topics/typescript.md",
"other-topics/resources.md",
"other-topics/upgrade-to-v6.md",
"other-topics/whos-using.md",
"other-topics/legal.md"
],
"__hidden__": [
"moved/associations.md",
"moved/data-types.md",
"moved/models-definition.md",
"moved/models-usage.md",
"moved/querying.md"
]
}
}

0 comments on commit 57a8ae9

Please sign in to comment.