@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
26 lines • 930 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryBase = void 0;
/**
* A convenient base class for most (but not all) of the queries, where the
* Runner instance is the same for different query input shapes. If the query
* doesn't fit the QueryBase framework (like PgQueryUpdate for instance where we
* have separate Runner instances for separate set of updated fields), a Query
* is used directly instead.
*/
class QueryBase {
constructor(schema, input) {
this.schema = schema;
this.input = input;
}
get IS_WRITE() {
return this.RUNNER_CLASS.IS_WRITE;
}
async run(client, annotation) {
return client
.batcher(this.constructor, this.schema, "", false, () => new this.RUNNER_CLASS(this.schema, client))
.run(this.input, annotation);
}
}
exports.QueryBase = QueryBase;
//# sourceMappingURL=QueryBase.js.map
;