Skip to content

Commit 165fb3d

Browse files
committed
Updates drivers .count() to avoid using opts.id
1 parent 5396b67 commit 165fb3d

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/Drivers/DML/mysql.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Driver.prototype.find = function (fields, table, conditions, opts, cb) {
137137
Driver.prototype.count = function (table, conditions, opts, cb) {
138138
var q = this.query.select()
139139
.from(table)
140-
.count(opts.id, 'c');
140+
.count(null, 'c');
141141

142142
if (opts.merge) {
143143
q.from(opts.merge.from.table, opts.merge.from.field, opts.merge.to.field);

‎lib/Drivers/DML/postgres.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Driver.prototype.find = function (fields, table, conditions, opts, cb) {
160160
Driver.prototype.count = function (table, conditions, opts, cb) {
161161
var q = this.query.select()
162162
.from(table)
163-
.count(opts.id, 'c');
163+
.count(null, 'c');
164164

165165
if (opts.merge) {
166166
q.from(opts.merge.from.table, opts.merge.from.field, opts.merge.to.field);

‎lib/Drivers/DML/sqlite.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Driver.prototype.find = function (fields, table, conditions, opts, cb) {
108108
Driver.prototype.count = function (table, conditions, opts, cb) {
109109
var q = this.query.select()
110110
.from(table)
111-
.count(opts.id, 'c');
111+
.count(null, 'c');
112112

113113
if (opts.merge) {
114114
q.from(opts.merge.from.table, opts.merge.from.field, opts.merge.to.field);

0 commit comments

Comments
 (0)