groupBy.test.js 1.1 KB

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