knex/lib/functionhelper.js
2019-07-10 23:48:43 +02:00

15 lines
333 B
JavaScript

// FunctionHelper
// -------
function FunctionHelper(client) {
this.client = client;
}
FunctionHelper.prototype.now = function(precision) {
if (typeof precision === 'number') {
return this.client.raw(`CURRENT_TIMESTAMP(${precision})`);
}
return this.client.raw('CURRENT_TIMESTAMP');
};
module.exports = FunctionHelper;