基于 Node.js 的 ORM,Sequelize 2.0.0RC7 發布

jopen 9年前發布 | 6K 次閱讀 ?Sequelize

Sequelize.js 提供對 MySQL,MariaDB,SQLite 和 PostgreSQL 數據庫的簡單訪問,通過映射數據庫條目到對象,或者對象到數據庫條目。簡而言之,就是 ORM(Object-Relational-Mapper)。Sequelize.js 完全是使用 JavaScript 編寫,適用于 Node.js 的環境。

Sequelize 2.0.0RC7 發布,此版本現已提供下載:Sequelize 3.0.0.RC7.zip,主要更新內容如下:

  • [FEATURE] Throw an error if no where clause is given toModel.destroy().

    </li>

  • [BUG] Fixed issue withorder: sequelize.literal('string')

    </li>

  • [FEATURE] addclone: truesupport to.get(). Is needed when usingdeleteon values from a.get()(toJSON(),this.values). (.get() is just a reference to the values for performance reasons when there's no custom getters or includes)

    </li>

  • [FEATURE] addsequelize.escape(value)convenience method

    </li>

  • [BUG] Fixes crash withfindAll({include: [Model], order: sequelize.literal()})

    </li>

  • [FEATURE] Now possible to passcreatedAtandupdatedAtvalues toModel.create/Model.bulkCreatewhen using silent: true (when importing datasets with existing timestamps)

    </li>

  • [FEATURE]instance.update()using default fields will now automatically also save and validate values provided viabeforeUpdatehooks

    </li>

  • [BUG] Fixed bad SQL when updating a JSON attribute with a differentfield

    </li>

  • [BUG] Fixed issue with creating and updating values of aDataTypes.ARRAY(DataTypes.JSON)attribute

    </li>

  • [BUG]Model.bulkCreate([{}], {returning: true})will now correctly result in instances with primary key values.

    </li>

  • [BUG]instance.save()withfields: [](as a result of.changed()being[]) will no result in a noop instead of an empty update query.

    </li>

  • [BUG] Fixed case wherefindOrCreatecould return[null, true]when given adefaultsvalue that triggered a unique constraint error.

    </li> </ul>

    向后兼容改進

    • instance.update()using default fields will now automatically also save and validate values provided viabeforeUpdatehooks

      </li>

    • Sequelize no longer supports case insensitive mysql enums

      </li> </ul> 更多內容請看更新日志

      來自:http://www.oschina.net/news/58633/sequelize-2-0-0-rc7

       本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
       轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
       本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!