ts-db-helper
Version:
Simple ORM based on TypeScript
54 lines • 1.57 kB
JavaScript
/**
* @public
* @class DbQuery
*
* @description
* This class is a model to share query informations specifically to
* the query connector.
*
* @author Olivier Margarit
* @since 0.1
*/
var DbQuery = /** @class */ (function () {
function DbQuery() {
/**
* @public
* @property {number} page the page number to retrieve for select queries
*/
this.page = 0;
/**
* @public
* @property {Array<any>} params list of params of the query, see the sqlite
* documenetations to learn about query parameters
*/
this.params = [];
/**
* @public
* @property {string} query the query string
*/
this.query = '';
/**
* @public
* @property {number} size the number of result to retrieve per page
* on select statement
*/
this.size = 1000;
}
/**
* @public
* @method append is a part of private API.
* this method is used to build query by appending part of it
*
* @param {QueryPart} queryPart query part to append
*
* @return {DbQuery} the db query instance to chain part appending
*/
DbQuery.prototype.append = function (queryPart) {
this.query = this.query.trim() + ' ' + queryPart.content.trim();
this.params = this.params.concat(queryPart.params);
return this;
};
return DbQuery;
}());
export { DbQuery };
//# sourceMappingURL=db-query.model.js.map