1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- var Test = require('../../support/test-runner');
- describe('Query Generation ::', function() {
- describe('CROSS JOINS ::', function() {
- it('should generate a basic cross join query', function(done) {
- Test({
- query: {
- select: ['users.id', 'contacts.phone'],
- from: 'users',
- crossJoin: [
- {
- from: 'contacts',
- on: {
- users: 'id',
- contacts: 'user_id'
- }
- }
- ]
- },
- outcomes: [
- {
- dialect: 'postgresql',
- sql: 'select "users"."id", "contacts"."phone" from "users" cross join "contacts" on "users"."id" = "contacts"."user_id"',
- bindings: []
- },
- {
- dialect: 'mysql',
- sql: 'select `users`.`id`, `contacts`.`phone` from `users` cross join `contacts` on `users`.`id` = `contacts`.`user_id`',
- bindings: []
- },
- {
- dialect: 'sqlite3',
- sql: 'select "users"."id", "contacts"."phone" from "users" cross join "contacts" on "users"."id" = "contacts"."user_id"',
- bindings: []
- },
- {
- dialect: 'oracle',
- sql: 'select "users"."id", "contacts"."phone" from "users" cross join "contacts" on "users"."id" = "contacts"."user_id"',
- bindings: []
- },
- {
- dialect: 'mariadb',
- sql: 'select `users`.`id`, `contacts`.`phone` from `users` cross join `contacts` on `users`.`id` = `contacts`.`user_id`',
- bindings: []
- }
- ]
- }, done);
- });
- });
- });
|