1
This commit is contained in:
parent
46bf5c4dd5
commit
22eef8b27c
18
db.js
18
db.js
@ -222,6 +222,24 @@ class DB {
|
||||
};
|
||||
}
|
||||
|
||||
async getMaxIdx(tblName) {
|
||||
const params = [];
|
||||
let sql = 'SELECT max(idx) AS max_idx FROM `' + tblName + '` ';
|
||||
|
||||
const {err, row} = await this.execQueryOne(sql, params);
|
||||
if (err) {
|
||||
return {
|
||||
'err': err,
|
||||
'maxIdx': BigInt(0)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'err': err,
|
||||
'maxIdx': row && row['max_idx'] != null ? BigInt(row['max_idx']) : BigInt(0)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = DB;
|
||||
|
Loading…
x
Reference in New Issue
Block a user