Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork493
Sequelize 文档的中文版本: v7.0.0-alpha.18 | v6.32.0
License
demopark/sequelize-docs-Zh-CN
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
此项目同步自sequelize /sequelize 项目.
更新日志请参阅:CHANGELOG
Sequelize 是一个易用且基于 promise 的Node.jsORM 工具 适用于Postgres,MySQL,MariaDB,SQLite,DB2,Microsoft SQL Server,Snowflake,Oracle DB 和Db2 for IBM i. 它具有强大的事务支持, 关联关系, 预读和延迟加载,读取复制等功能.
Sequelize 遵从语义版本控制 和官方 Node.js LTS 版本. Sequelize v7 版本正式支持 Node.js^14.17,0
,^16.0.0
. 其他版本或可正常工作.
你目前正在查看 Sequelize 的教程和指南.你可能还对API 参考 (英文)感兴趣.
在此处可以找到主要版本的升级信息:
注意 由于当前alpha阶段api调整, 文档中的API参考指向尚未确定. 可前往V7 API 参考自行查询.
- Getting Started - 入门
- Model Basics - 模型基础
- Model Instances - 模型实例
- Model Querying - Basics - 模型查询(基础)
- Model Querying - Finders - 模型查询(查找器)
- Getters, Setters & Virtuals - 获取器, 设置器 & 虚拟字段
- Validations & Constraints - 验证 & 约束
- Raw Queries - 原始查询
- Associations - 关联
- Paranoid - 偏执表
- Eager Loading - 预先加载
- Creating with Associations - 创建关联
- Advanced M:N Associations - 高级 M:N 关联
- Association Scopes - 关联作用域
- Polymorphic Associations - 多态关联
- Dialect-Specific Things - 方言特定事项
- Transactions - 事务
- Hooks - 钩子
- Query Interface - 查询接口
- Naming Strategies - 命名策略
- Scopes - 作用域
- Sub Queries - 子查询
- Other Data Types - 其他数据类型
- Constraints & Circularities - 约束 & 循环
- Extending Data Types - 扩展数据类型
- Indexes - 索引
- Optimistic Locking - 乐观锁定
- Read Replication - 读取复制
- Connection Pool - 连接池
- Working with Legacy Tables - 使用遗留表
- Migrations - 迁移
- TypeScript
- Resources - 资源
# 使用 npmnpm install sequelize# 这将安装最新版本的 Sequelize# 使用 yarnyarn add sequelize
# 用于支持数据库方言的库:# 使用 npmnpm i pg pg-hstore# PostgreSQLnpm i mysql2# MySQLnpm i mariadb# MariaDBnpm i sqlite3# SQLitenpm i tedious# Microsoft SQL Servernpm i ibm_db# DB2npm i odbc# IBM i# 使用 yarnyarn add pg pg-hstore# PostgreSQLyarn add mysql2# MySQLyarn add mariadb# MariaDByarn add sqlite3# SQLiteyarn add tedious# Microsoft SQL Serveryarn add ibm_db# DB2yarn add odbc# IBM i
import{Sequelize,Model,DataTypes,InferAttributes,InferCreationAttributes}from'sequelize';constsequelize=newSequelize('sqlite::memory:');classUserextendsModel<InferAttributes<User>,InferCreationAttributes<User>>{declareusername:string|null;declarebirthday:Date|null;}User.init({username:DataTypes.STRING,birthday:DataTypes.DATE},{ sequelize,modelName:'user'});(async()=>{awaitsequelize.sync();constjane=awaitUser.create({username:'janedoe',birthday:newDate(1980,6,20),});console.log(jane.toJSON());})();
const{ Sequelize, Model, DataTypes}=require('sequelize');constsequelize=newSequelize('sqlite::memory:');classUserextendsModel{}User.init({username:DataTypes.STRING,birthday:DataTypes.DATE},{ sequelize,modelName:'user'});(async()=>{awaitsequelize.sync();constjane=awaitUser.create({username:'janedoe',birthday:newDate(1980,6,20)});console.log(jane.toJSON());})();
请通过Getting started - 入门 来学习更多相关内容. 如果你想要学习 Sequelize API 请通过API 参考 (英文).
About
Sequelize 文档的中文版本: v7.0.0-alpha.18 | v6.32.0
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.