@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
30 lines • 1.37 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEnt = BaseEnt;
const CacheMixin_1 = require("./mixins/CacheMixin");
const ConfigMixin_1 = require("./mixins/ConfigMixin");
const HelpersMixin_1 = require("./mixins/HelpersMixin");
const PrimitiveMixin_1 = require("./mixins/PrimitiveMixin");
/**
* This is a helper function to create new Ent classes. Run once per each
* Ent+Cluster on app boot. See examples in __tests__/TestObjects.ts and
* EntTest.ts.
*
* Since all Ent objects are immutable (following the modern practices),
* 1. Ent is not a DataMapper pattern;
* 2. Ent is not an ActiveRecord;
* 3. At last, Ent is not quite a DAO pattern too.
*
* We assume that Ents are very simple (we don't need triggers or multi-ent
* touching mutations), because we anyway have a GraphQL layer on top of it.
*
* Finally, a naming decision has been made: we translate database field names
* directly to Ent field names, no camelCase. This has proven its simplicity
* benefits in the past: the less translation layers we have, the easier it is
* to debug and develop.
*/
function BaseEnt(cluster, schema) {
return (0, HelpersMixin_1.HelpersMixin)((0, CacheMixin_1.CacheMixin)((0, PrimitiveMixin_1.PrimitiveMixin)((0, ConfigMixin_1.ConfigMixin)(class {
}, cluster, schema))));
}
//# sourceMappingURL=BaseEnt.js.map
;