1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- var Test = require('../../support/test-runner');
- describe('Query Generation ::', function() {
- describe('NULL operator ::', function() {
- describe('IS NULL ::', function() {
- it('should generate a query when a NULL value is used', function(done) {
- Test({
- query: {
- select: ['*'],
- from: 'users',
- where: {
- and: [
- {
- updatedAt: null
- }
- ]
- }
- },
- outcomes: [
- {
- dialect: 'postgresql',
- sql: 'select * from "users" where "updatedAt" is null',
- bindings: []
- },
- {
- dialect: 'mysql',
- sql: 'select * from `users` where `updatedAt` is null',
- bindings: []
- },
- {
- dialect: 'sqlite3',
- sql: 'select * from "users" where "updatedAt" is null',
- bindings: []
- },
- {
- dialect: 'oracle',
- sql: 'select * from "users" where "updatedAt" is null',
- bindings: []
- },
- {
- dialect: 'mariadb',
- sql: 'select * from `users` where `updatedAt` is null',
- bindings: []
- }
- ]
- }, done);
- });
- });
- describe('IS NOT NULL ::', function() {
- it('should generate a query when a NOT NULL value is used', function(done) {
- Test({
- query: {
- select: ['*'],
- from: 'users',
- where: {
- and: [
- {
- not: {
- updatedAt: null
- }
- }
- ]
- }
- },
- outcome: 'select * from "users" where "updatedAt" is not null'
- }, done);
- });
- });
- });
- });
|