delete.test.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var Test = require('../../support/test-runner');
  2. describe('Query Generation ::', function() {
  3. describe('DELETE statements', function() {
  4. it('should generate an insert query', function(done) {
  5. Test({
  6. query: {
  7. del: true,
  8. from: 'accounts',
  9. where: {
  10. and: [
  11. {
  12. activated: false
  13. }
  14. ]
  15. }
  16. },
  17. outcomes: [
  18. {
  19. dialect: 'postgresql',
  20. sql: 'delete from "accounts" where "activated" = $1',
  21. bindings: [false]
  22. },
  23. {
  24. dialect: 'mysql',
  25. sql: 'delete from `accounts` where `activated` = ?',
  26. bindings: [false]
  27. },
  28. {
  29. dialect: 'sqlite3',
  30. sql: 'delete from "accounts" where "activated" = ?',
  31. bindings: [false]
  32. },
  33. {
  34. dialect: 'oracle',
  35. sql: 'delete from "accounts" where "activated" = :1',
  36. bindings: ['0']
  37. },
  38. {
  39. dialect: 'mariadb',
  40. sql: 'delete from `accounts` where `activated` = ?',
  41. bindings: [false]
  42. }
  43. ]
  44. }, done);
  45. });
  46. });
  47. });