Ben Drucker 7cdda834ef Remove FoundationDB
Reverts c199761c597c93136a6d38bc4ecf26a693560322 and #641

Foundation was acquired and shut down immediately
2015-03-24 17:48:14 -07:00

86 lines
1.9 KiB
JavaScript

/*global describe, d, it*/
'use strict';
module.exports = function(knex) {
describe('Deletes', function () {
it('should handle deletes', function() {
return knex('accounts')
.where('id', 1)
.del()
.testSql(function(tester) {
tester(
'mysql',
'delete from `accounts` where `id` = ?',
[1],
1
);
tester(
'postgresql',
'delete from "accounts" where "id" = ?',
[1],
1
);
tester(
'sqlite3',
'delete from "accounts" where "id" = ?',
[1],
1
);
tester(
'oracle',
'delete from "accounts" where "id" = ?',
[1],
1
);
});
});
it('should allow returning for deletes in postgresql', function() {
return knex('accounts')
.where('id', 2)
.del('*')
.testSql(function(tester) {
tester(
'mysql',
'delete from `accounts` where `id` = ?',
[2],
1
);
tester(
'postgresql',
'delete from "accounts" where "id" = ? returning *',
[2],
[{
id: '2',
first_name: 'Test',
last_name: 'User',
email: 'test2@example.com',
logins: 1,
about: 'Lorem ipsum Dolore labore incididunt enim.',
created_at: d,
updated_at: d,
phone: null
}]
);
tester(
'sqlite3',
'delete from "accounts" where "id" = ?',
[2],
1
);
tester(
'oracle',
'delete from "accounts" where "id" = ?',
[2],
1
);
});
});
});
};