Edit This Page

Functions Usage

You can make use of functions from your Query object as follows:

  .select('id', function (column) {
    // `column` is in instance of `Functions` class here
    return column('title')
      .upper() // uppercase the `title` column
      .trim(); // and also trim the `title` column

You can also call it directly from the Query object if you already have it as a variable first:

var query = db.query();

  .select('id', {
    title: query.func('title')