发布于 2016-05-28 23:57:07 | 184 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

Sequelize Node.js的ORM 框架

Sequelize.js 提供对 MySQL,MariaDB,SQLite 和 PostgreSQL 数据库的简单访问,通过映射数据库条目到对象,或者对象到数据库条目。简而言之,就是 ORM(Object-Relational-Mapper)。Sequelize.js 完全是使用 JavaScript 编写,适用于 Node.js 的环境。


Sequelize v4.0 发布了,

更新内容:

changelog:

  • [FIXED] Pass ResourceLock instead of raw connection in MSSQL disconnect handling

  • [CHANGED] Remove hookValidate in favor of validate with hooks: true | false.

  • [REMOVED] Support for referencesKey

  • [CHANGED] Throw if dialect is not provided to the constructor

  • [CHANGED] Throw bluebird.AggregateError instead of array from bulkCreate when validation fails

  • [FIXED] $notIn: [] is now converted to NOT IN (NULL) #4859

  • [FIXED] Add raw support to instance.get() #5815

  • [ADDED] Compare deletedAt against current timestamp when using paranoid #5880

  • [FIXED] BIGINT gets truncated #5176

  • [FIXED] Trigger afterCreate hook after all nested includes (for hasMany or belongsToMany associations) have been created to be consistent with hasOne.

  • [REMOVED] Support for pool:false

  • [REMOVED] Default transaction isolation level #5094

  • [ADDED] Add logging for mysql warnings, observant of the showWarnings option. #5900

  • [REMOVED] MariaDB dialect

  • [FIXED] hasOne now prefer aliases to construct foreign key #5247

  • [CHANGED] instance.equals now only checks primary keys, instead of all attributes.

  • [REWRITE] Rewrite model and instance to a single class - instance instanceof Model #5924

  • [REMOVED] Counter cache plugin

BC breaks:

  • hookValidate removed in favor of validate with hooks: true | falsevalidate returns a promise which is rejected if validation fails

  • Removed support for referencesKey, use a references object

  • Remove default dialect

  • When bulkCreate is rejected because of validation failure it throws a bluebird.AggregateErrorinstead of an array. This object is an array-like so length and index access will still work, butinstanceof array will not

  • $notIn: [] will now match all rows instead of none

  • (MySQL) BIGINT now gets converted to string when number is too big

  • Removed support for pool:false, if you still want to use single connection set pool.max to 1

  • Removed default REPEATABLE_READ transaction isolation, use config option to explicitly set it

  • Removed MariaDB dialect - this was just a thin wrapper around MySQL, so using dialect: 'mysql' instead should work with no further changes

  • hasOne now prefer as option to generate foreign key name, otherwise it defaults to source model name

  • instance.equals now provides reference equality (do two instances refer to the same row, i.e. are their primary key(s) equal). Use instance.get() to get and compare all values.

  • Instances (database rows) are now instances of the model, instead of being a separate class. This means you can replace User.build() with new User() and sequelize.define with User extends Sequelize.Model. See #5924

  • The counter cache plugin, and consequently the counterCache option for associations has been removed. The plugin is seeking a new maintainer - You can find the code here

下载地址:



历史版本 :
Sequelize v4.31.0 发布,Node.js 的 ORM
Sequelize 4.29.1 和 4.29.2 发布,Node.js 的 ORM
Sequelize 4.29.0 发布,Node.js 的 ORM
Sequelize 4.28.0 发布,Node.js 的 ORM
Sequelize 4.22.16 和 4.23.0 发布,Node.js 的 ORM
Sequelize 4.22.9 发布,Node.js 的 ORM
Sequelize 4.22.2 和 4.22.3 和 4.22.4 发布,Node.js 的 ORM
Sequelize 4.15.0 发布,Node.js 的 ORM
Sequelize 4.14.0 发布,Node.js 的 ORM
Sequelize 4.13.16 和 4.13.17 发布,Node.js 的 ORM
Sequelize 4.13.11-15 发布,Node.js 的 ORM
Sequelize 4.13.9 和 4.13.10 发布,Node.js 的 ORM
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务