Skip to content

Commit

Permalink
test(QueryBuilder): add test for countDistinct with multiple columns
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmukuthu committed Jan 31, 2018
1 parent c1997e9 commit 3c1236e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/unit/query/builder.js
Expand Up @@ -2498,6 +2498,31 @@ describe("QueryBuilder", function() {
});
});

it("count distinct with multiple columns", function() {
testsql(qb().from('users').countDistinct('foo', 'bar'), {
mysql: {
sql: 'select count(distinct `foo`, `bar`) from `users`',
bindings: []
},
oracle: {
sql: 'select count(distinct "foo", "bar") from "users"',
bindings: []
},
mssql: {
sql: 'select count(distinct [foo], [bar]) from [users]',
bindings: []
},
oracledb: {
sql: 'select count(distinct "foo", "bar") from "users"',
bindings: []
},
postgres: {
sql: 'select count(distinct "foo", "bar") from "users"',
bindings: []
}
});
});

it("max", function() {
testsql(qb().from('users').max('id'), {
mysql: {
Expand Down

0 comments on commit 3c1236e

Please sign in to comment.