sequelizer.opts.schema.test.js 576 B

1234567891011121314151617181920
  1. var Sequelizer = require('../../../index')({ dialect: 'postgres' }).sequelizer;
  2. var analyze = require('../../support/analyze');
  3. var assert = require('assert');
  4. describe('Sequelizer ::', function() {
  5. describe('OPTS', function() {
  6. it('should support schemas', function() {
  7. var tree = analyze({
  8. select: ['title', 'author', 'year'],
  9. from: 'books',
  10. opts: {
  11. schema: 'foo'
  12. }
  13. });
  14. var result = Sequelizer(tree);
  15. assert.equal(result.sql, 'select "title", "author", "year" from "foo"."books"');
  16. });
  17. });
  18. });