How to use the comb.executeInOrder function in comb

To help you get started, we’ve selected a few comb 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 C2FO / patio / test / data / manyToOne / eager.models.js View on Github external
exports.loadModels = function() {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function(helper, patio) {
        var DB = helper.createTables();
        var Company = patio.addModel(DB.from("company"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.oneToMany("employees", {fetchType : this.fetchType.EAGER});
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.manyToOne("company", {fetchType : this.fetchType.EAGER});
                }
            }
github C2FO / patio / test / data / timestampPlugin / timestamp.updateOnCreate.models.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB = helper.createTables();
        var Employee = patio.addModel(DB.from("employee"), {
            plugins:[patio.plugins.TimeStampPlugin]
        });
        Employee.timestamp({updateOnCreate : true});
        patio.syncModels();
    });
};
github C2FO / patio / test / data / oneToOne / customFilter.lazy.models.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB = helper.createTables();
        var Works = patio.addModel(DB.from("works"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.manyToOne("employee");
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.oneToOne("works", function (ds) {
                        return ds.filter(function () {
                            return this.salary.gte(100000.00);
github C2FO / patio / test / data / model.camelCase.model.js View on Github external
exports.dropModels = function () {
    return comb.executeInOrder(patio, DB, function (patio, db) {
        db.forceDropTable("employee");
        patio.disconnect();
        patio.identifierInputMethod = null;
        patio.identifierOutputMethod = null;
    });
};
github C2FO / patio / test / data / model.models.js View on Github external
exports.dropModels = function () {
    return comb.executeInOrder(patio, DB, function (patio, db) {
        db.forceDropTable("employee");
        patio.disconnect();
        patio.identifierInputMethod = null;
        patio.identifierOutputMethod = null;
    });
};
github C2FO / patio / test / data / oneToOne / customFilter.eager.models.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB = helper.createTables();
        var Works = patio.addModel(DB.from("works"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.manyToOne("employee", {fetchType:this.fetchType.EAGER});
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.oneToOne("works", {fetchType:this.fetchType.EAGER}, function (ds) {
                        return ds.filter(function () {
                            return this.salary.gte(100000.00);
github C2FO / patio / test / data / manyToOne / lazy.models.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB = helper.createTables();
        var Company = patio.addModel(DB.from("company"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.oneToMany("employees");
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.manyToOne("company");
                }
            }
github C2FO / patio / test / data / manyToMany / camelize.models.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB = helper.createTables(true);
        var Company = patio.addModel(DB.from("company"), {
            static:{

                identifierOutputMethod:"camelize",

                identifierInputMethod:"underscore",

                init:function () {
                    this._super(arguments);
                    this.manyToMany("employees");
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
github C2FO / patio / test / data / manyToOne / stringKey.js View on Github external
exports.loadModels = function () {
    var ret = new comb.Promise();
    return comb.executeInOrder(helper, patio, function (helper, patio) {
        var DB =  helper.createTables();
        var Company = patio.addModel(DB.from("company"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.oneToMany("employees", {key:"companyId"});
                }
            }
        });
        var Employee = patio.addModel(DB.from("employee"), {
            static:{
                init:function () {
                    this._super(arguments);
                    this.manyToOne("company", {key:"companyId"});
                }
            }
github C2FO / patio / example / application / schemas.js View on Github external
exports.dropTableAndDisconnect = function () {
    return comb.executeInOrder(patio, DB, function (patio, db) {
        db.forceDropTable(["leg_instance", "flight_leg", "flight", "airplane", "can_land", "airplane_type", "airport"]);
        patio.disconnect();
    });
};