knex/src/functionhelper.js

15 lines
331 B
JavaScript
Raw Normal View History

2015-05-09 13:58:18 -04:00
// FunctionHelper
// -------
function FunctionHelper(client) {
this.client = client;
2015-05-09 13:58:18 -04:00
}
FunctionHelper.prototype.now = function(precision) {
if (typeof precision === 'number') {
return this.client.raw(`CURRENT_TIMESTAMP(${precision})`);
}
return this.client.raw('CURRENT_TIMESTAMP');
};
2015-05-09 13:58:18 -04:00
export default FunctionHelper;