不要怂,就是干,撸起袖子干!

Commit 63f11616 by Matt Broadstone

add dialect checks for upsert support

Upserts in MSSQL are non-trivial to implement, adding the ability
to test for support is a valid stopgap for later implementation
1 parent 313b78b8
......@@ -34,6 +34,7 @@ AbstractDialect.prototype.supports = {
schemas: false,
transactions: true,
migrations: true,
upserts: true,
constraints: {
restrict: true
},
......
......@@ -12,7 +12,8 @@ var chai = require('chai')
, dialect = Support.getTestDialect()
, datetime = require('chai-datetime')
, _ = require('lodash')
, assert = require('assert');
, assert = require('assert')
, current = Support.sequelize;
chai.use(datetime);
chai.config.includeStack = true;
......@@ -40,6 +41,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
this.clock.restore();
});
if (current.dialect.supports.upserts) {
describe('upsert', function () {
it('works with upsert on id', function () {
return this.User.upsert({ id: 42, username: 'john' }).bind(this).then(function (created) {
......@@ -91,4 +93,6 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
});
});
});
}
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!