UNPKG

waterline-sql-builder

Version:

Generate SQL (stage 5 query) from a Waterline statement (stage 4 query).

45 lines (43 loc) 1.18 kB
var Test = require('../../support/test-runner'); describe('Query Generation ::', function() { describe('OPTS', function() { it('should support schemas', function(done) { Test({ query: { select: ['title', 'author', 'year'], from: 'books', opts: { schema: 'foo' } }, outcomes: [ { dialect: 'postgresql', sql: 'select "title", "author", "year" from "foo"."books"', bindings: [] }, { dialect: 'mysql', sql: 'select `title`, `author`, `year` from `foo`.`books`', bindings: [] }, { dialect: 'sqlite3', sql: 'select `title`, `author`, `year` from `foo`.`books`', bindings: [] }, { dialect: 'oracledb', sql: 'select "title", "author", "year" from "foo"."books"', bindings: [] }, { dialect: 'mariadb', sql: 'select `title`, `author`, `year` from `foo`.`books`', bindings: [] } ] }, done); }); }); });