count.test.js 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var Test = require('../../support/test-runner');
  2. describe('Query Generation ::', function() {
  3. describe('COUNT statements', function() {
  4. it('should generate a count query', function(done) {
  5. Test({
  6. query: {
  7. count: true,
  8. from: 'users'
  9. },
  10. outcomes: [
  11. {
  12. dialect: 'postgresql',
  13. sql: 'select count(*) from "users"',
  14. bindings: []
  15. },
  16. {
  17. dialect: 'mysql',
  18. sql: 'select count(*) from `users`',
  19. bindings: []
  20. },
  21. {
  22. dialect: 'sqlite3',
  23. sql: 'select count(*) from "users"',
  24. bindings: []
  25. },
  26. {
  27. dialect: 'oracle',
  28. sql: 'select count(*) from "users"',
  29. bindings: []
  30. },
  31. {
  32. dialect: 'mariadb',
  33. sql: 'select count(*) from `users`',
  34. bindings: []
  35. }
  36. ]
  37. }, done);
  38. });
  39. });
  40. });