Sequelize v4.0.0-1 发布 - Node.js 的 ORM

jopen 3年前
   <p style="text-align: center;"><img alt="" src="https://simg.open-open.com/show/b34ed8e87d8697201f0dc1b339928e9d.png" /></p>    <p>Sequelize.js 提供对 MySQL,MariaDB,SQLite 和 PostgreSQL 数据库的简单访问,通过映射数据库条目到对象,或者对象到数据库条目。简而言之,就是 ORM(Object-Relational-Mapper)。Sequelize.js 完全是使用 JavaScript 编写,适用于 Node.js 的环境。</p>    <h2>更新日志</h2>    <ul>     <li>[CHANGED] Removed <code>modelManager</code> parameter from <code>Model.init()</code> <a href="/misc/goto?guid=4958993305657608183">#6437</a></li>     <li>[FIXED] Made <code>Model.init()</code> behave like <code>sequelize.define()</code> (hooks are called and options have proper defaults) <a href="/misc/goto?guid=4958993305657608183">#6437</a></li>     <li>[ADDED] <code>restartIdentity</code> option for truncate in postgres <a href="/misc/goto?guid=4958993305783652042">#5356</a></li>     <li>[INTERNAL] Migrated to <code>node-mysql2</code> for prepared statements <a href="/misc/goto?guid=4958993305880687662">#6354</a></li>     <li>[ADDED] SQLCipher support via the SQLite connection manager</li>     <li>[CHANGED] Range type bounds now default to <a href="/misc/goto?guid=4958993305993172617">postgres default</a> <code>[)</code> (inclusive, exclusive) <a href="/misc/goto?guid=4958993306095359648">#5990</a></li>     <li>[ADDED] Support for range operators <a href="/misc/goto?guid=4958993306095359648">#5990</a></li>     <li>[FIXED] Broken transactions in <code>MySQL</code> <a href="/misc/goto?guid=4958993306209693108">#3568</a></li>     <li>[FIXED] <code>Model.count</code> don't include attributes <a href="/misc/goto?guid=4958993306314655361">#5057</a></li>     <li>[INTERNALS] Updated <code>inflection</code> dependency and pinned version and expose all used <code>inflection</code>methods on <code>Utils</code></li>     <li>[ADDED] <code>Sequelize.useInflection</code> method</li>     <li>[FIXED] <code>hasOne</code> throws error on update with a primary key <a href="/misc/goto?guid=4958993306411296964">#6069</a></li>     <li>[FIXED] <code>Model.count</code> gives SQL syntax error when using <code>distinct</code> <a href="/misc/goto?guid=4958993306516838735">#4840</a></li>     <li>[ADDED] <code>Model.count</code> now allow specifying column to count on, use <code>options.col</code> <a href="/misc/goto?guid=4958993306617915135">#4442</a></li>     <li>[ADDED] <code>DEBUG</code> support <a href="/misc/goto?guid=4958993306718946515">#2852</a></li>     <li>[ADDED] Intensive connection logging <a href="/misc/goto?guid=4958993306823522963">#851</a></li>     <li>[FIXED] Only <code>belongsTo</code> uses <code>as</code> to construct foreign key - revert of <a href="/misc/goto?guid=4958993306926155285">#5957</a> introduced in 4.0.0-0</li>     <li>[CHANGED] <code>Sequelize.Promise</code> is now an independent copy of <code>bluebird</code> library <a href="/misc/goto?guid=4958993307047109601">#5974</a></li>     <li>[ADDED] before/after Save hook <a href="/misc/goto?guid=4958993307173121429">#2702</a></li>     <li>[ADDED] Remove hooks by reference <a href="/misc/goto?guid=4958993307295573992">#6155</a></li>     <li>[ADDED] before/after Upsert hook <a href="/misc/goto?guid=4958993307418383633">#3965</a></li>     <li>[FIXED] Modifying <code>options</code> in <code>beforeFind</code> throws error <a href="/misc/goto?guid=4958993307552307028">#5675</a></li>     <li>[REMOVED] <code>classMethods</code> and <code>instanceMethods</code> <a href="/misc/goto?guid=4958993307685067067">#5869</a></li>     <li>[CHANGED] <code>Sequelize.Validator</code> is now an independent copy of <code>validator</code> library</li>     <li>[FIXED] Don't patch <code>validator</code> library globally <a href="/misc/goto?guid=4958993307822061410">#6196</a></li>     <li>[CHANGED] <code>ignore</code> for create was renamed to <code>ignoreDuplicates</code> <a href="/misc/goto?guid=4958993307964837737">#6138</a></li>     <li>[FIXED] Index names not quoted properly in <code>removeIndex</code> <a href="/misc/goto?guid=4958993308093445232">#5888</a></li>     <li>[FIXED] <code>Int4</code> range not properly parsed <a href="/misc/goto?guid=4958993308224353071">#5747</a></li>     <li>[FIXED] <code>upsert</code> does not fail anymore on not null validations <a href="/misc/goto?guid=4958993308361383275">#5711</a></li>     <li>[FIXED] Don't remove includes from count queries and unify findAndCount and count queries. <a href="/misc/goto?guid=4958993308484455312">#6123</a></li>     <li>[FIXED] <code>Model.count</code> with <code>options.col</code> and <code>options.include</code> works properly now</li>     <li>[FIXED] <code>bulkCreate</code> don't map fields to attributes properly <a href="/misc/goto?guid=4958993308615051925">#4476</a><a href="/misc/goto?guid=4958993308751200729">#3908</a><a href="/misc/goto?guid=4958993308889048076">#4103</a><a href="/misc/goto?guid=4958993309018798478">#3764</a><a href="/misc/goto?guid=4958993309150290357">#3789</a><a href="/misc/goto?guid=4958993309273039925">#4600</a></li>     <li>[FIXED] <code>sync</code> don't handle global <code>options.logging</code> properly <a href="/misc/goto?guid=4958993309396990977">#5788</a></li>     <li>[FIXED] <code>attribute:[]</code> throw errors with <code>include</code> or <code>through</code> <a href="/misc/goto?guid=4958993309522486768">#5078</a> <a href="/misc/goto?guid=4958993309660972640">#4222</a> <a href="/misc/goto?guid=4958993309784643783">#5958</a> <a href="/misc/goto?guid=4958993309908567079">#5590</a> <a href="/misc/goto?guid=4958993310039906987">#6139</a><a href="/misc/goto?guid=4958993310158879938">#4866</a> <a href="/misc/goto?guid=4958993310285540434">#6242</a></li>     <li>[SECURITY] <code>GEOMETRY</code> and <code>GEOGRAPHY</code> SQL injection attacks <a href="/misc/goto?guid=4958993310421939991">#6194</a></li>     <li>[FIXED] <code>DECIMAL</code> now supports <code>UNSIGNED</code> / <code>ZEROFILL</code> (MySQL) <a href="/misc/goto?guid=4958993310545013418">#2038</a></li>     <li>[FIXED] Generate correct SQL of nested include when quoteIdentifiers is false. (Postgres) <a href="/misc/goto?guid=4958993310671355146">#6351</a></li>     <li>[FIXED] Generate correct SQL for JSON attributes with quote. <a href="/misc/goto?guid=4958993310793039870">#6406</a></li>     <li>[FIXED] Nested query return correct result when quoteIdentifiers is false. (Postgres) <a href="/misc/goto?guid=4958993310917729143">#6363</a></li>     <li>[FIXED] Fixed an issue where changing multiple ENUM columns in PostgreSQL could break. <a href="/misc/goto?guid=4958993311037132914">#6203</a></li>     <li>[FIXED] Add <code>parent</code>, <code>original</code> and <code>sql</code> properties to <code>UniqueConstraintError</code></li>    </ul>    <h2>下载</h2>    <ul>     <li><a href="/misc/goto?guid=4958993311167317048" rel="nofollow"><strong>Source code</strong> (zip)</a></li>     <li><a href="/misc/goto?guid=4958993311285955839" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li>    </ul>    <p>本站原创,转载时保留以下信息:<br /> 本文转自:深度开源(open-open.com)<br /> 原文地址:<a href="http://www.open-open.com/news/view/4c533c34">http://www.open-open.com/news/view/4c533c34</a></p>