How to use the knex.Promise.resolve function in knex

To help you get started, we’ve selected a few knex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Vincit / objection.js / src / queryBuilder / GraphInserter.js View on Github external
if (ref) {
        // Copy all the properties to the reference nodes.
        let actualNode = getNode(this.graph.nodesById, ref);
        let relations = actualNode.modelClass.getRelations();

        _.forOwn(actualNode.model, (value, key) => {
          if (!getRelation(relations, key) && !_.isFunction(value)) {
            refNode.model[key] = value;
          }
        });

        refNode.model.$omit(refNode.modelClass.uidProp, refNode.modelClass.uidRefProp);
      }
    }

    return Promise.resolve(this.models);
  }
}