@liberation-data/drivine
Version:
Best and fastest graph database client for TypeScript / Node.js. Provides a level of abstraction for building highly scalable applications, without compromising architectural integrity
28 lines • 893 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuerySpecificationCompiler = void 0;
class QuerySpecificationCompiler {
constructor(spec) {
this.spec = spec;
}
compile() {
return {
statement: this.formattedStatement().trim(),
parameters: this.formattedParams()
};
}
appliedStatement() {
return `${this.spec.statement.text} ${this.skipClause()} ${this.limitClause()}`;
}
skipClause() {
if (this.spec._skip) {
return `${this.spec.statement.language === 'CYPHER' ? `SKIP` : `OFFSET`} ${this.spec._skip}`;
}
return ``;
}
limitClause() {
return this.spec._limit ? `LIMIT ${this.spec._limit}` : ``;
}
}
exports.QuerySpecificationCompiler = QuerySpecificationCompiler;
//# sourceMappingURL=QuerySpecificationCompiler.js.map