title: update column values with call to javascript function using knex update
body: <p>I'm anonymising data using knex migrations. I'm using the faker library to generate random street names that will replace the real street names. I need the knex update statement to call the faker.address.streetAddress() function as it would call any other mysql function ( RAND() for example ).</p>
  <p>The workaround I have found is significantly less performant.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const faker = require("faker/locale/de");
  
  exports.up = function (knex) {
    // generate a random character in the set ('A', 'B', 'C')
    return knex("Address").update(
      "street",
      knex.raw("CHAR(FLOOR( 65 + RAND( ) *3 ))")
    );
    // alternative is not very performant
    return knex("Address")
      .pluck("id")
      .then(function (ids) {
        return Promise.all(
          ids.map((id) =&gt;
            knex("Address")
              .where({ id: id })
              .update({ street: faker.address.streetAddress() })
          )
        );
      });
  };
  
  exports.down = function (knex) {};</code></pre>
  </div>
  </div>
  </p>