schema.test.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var Test = require('../../support/test-runner');
  2. describe('Query Generation ::', function() {
  3. describe('OPTS', function() {
  4. it('should support schemas', function(done) {
  5. Test({
  6. query: {
  7. select: ['title', 'author', 'year'],
  8. from: 'books',
  9. opts: {
  10. schema: 'foo'
  11. }
  12. },
  13. outcomes: [
  14. {
  15. dialect: 'postgresql',
  16. sql: 'select "title", "author", "year" from "foo"."books"',
  17. bindings: []
  18. },
  19. {
  20. dialect: 'mysql',
  21. sql: 'select `title`, `author`, `year` from `foo`.`books`',
  22. bindings: []
  23. },
  24. {
  25. dialect: 'sqlite3',
  26. sql: 'select "title", "author", "year" from "foo"."books"',
  27. bindings: []
  28. },
  29. {
  30. dialect: 'oracle',
  31. sql: 'select "title", "author", "year" from "foo"."books"',
  32. bindings: []
  33. },
  34. {
  35. dialect: 'mariadb',
  36. sql: 'select `title`, `author`, `year` from `foo`.`books`',
  37. bindings: []
  38. }
  39. ]
  40. }, done);
  41. });
  42. });
  43. });