Sequelize中文文档
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DemoPark 012ecad2f3
update ISSUE_TEMPLATE
2 months ago
.github update ISSUE_TEMPLATE 2 months ago
advanced-association-concepts update v6 docs 5 months ago
core-concepts Update assocs.md 4 months ago
other-topics update v6 docs 5 months ago
CHANGELOG.md update v6 docs 5 months ago
ISSUE_TEMPLATE.md Create ISSUE_TEMPLATE.md 3 months ago
LICENSE Create LICENSE 2 years ago
Readme.md update v6 docs 5 months ago
_config.yml Set theme jekyll-theme-cayman 2 years ago

Readme.md

Sequelize Docs 中文版

npm version Travis Build Status Appveyor Build Status npm downloads codecov Last commit Merged PRs GitHub stars Slack Status node License semantic-release

此项目同步自 sequelize / sequelize 项目中的 docs. 除特殊情况, 将保持每月一次的同步频率.

更新日志请参阅: CHANGELOG

Sequelize 是一个基于 promise 的 Node.js ORM, 目前支持 Postgres, MySQL, MariaDB, SQLite 以及 Microsoft SQL Server. 它具有强大的事务支持, 关联关系, 预读和延迟加载,读取复制等功能.

Sequelize 遵从 语义版本控制. 支持 Node v10 及更高版本以便使用 ES6 功能.

你目前正在查看 Sequelize 的教程和指南.你可能还对API 参考 (英文)感兴趣.

版本

v6 中文文档(v6 现在处于 beta 阶段)

v5 中文文档

v4 中文文档(停止更新)

文档(v6-beta)

核心概念

高级关联概念

其它主题

简单示例

const { Sequelize, Model, DataTypes } = require('sequelize');
const sequelize = new Sequelize('sqlite::memory:');

class User extends Model {}
User.init({
  username: DataTypes.STRING,
  birthday: DataTypes.DATE
}, { sequelize, modelName: 'user' });

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

请通过 Getting started - 入门 来学习更多相关内容. 如果你想要学习 Sequelize API 请通过 API 参考 (英文).

赞赏支持

赞赏支持