UNPKG

database-builder

Version:

Library to assist in creating and maintaining SQL commands.

52 lines (51 loc) 2.33 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.WhereBuilder = void 0; var utils_1 = require("../core/utils"); var where_base_builder_1 = require("./where-base-builder"); // TODO: add LambdaExpression support in WhereBuilder /** * TODO: Verificar possibilidade de dar suporte para ao invês de passar uma coluna * em formato string arbritaria utilizar keyof para permitir string com o nome das * propriedades, o que seria mais eficiente do que utilizar expression que teriam * que ser resolvidas em tempo de execução com manipulação de string e * ainda assim garantiria uma validação de nomes de porpriedades do typescript * assim como o que temos com expression hoje. * Teriamos que verificar se a refatoração de propriedades cobre keyof * link: https://stackoverflow.com/questions/50949905 */ /** * WhereBuilder */ var WhereBuilder = /** @class */ (function (_super) { __extends(WhereBuilder, _super); function WhereBuilder() { return _super !== null && _super.apply(this, arguments) || this; } WhereBuilder.prototype._getInstance = function () { return this; }; WhereBuilder.prototype._create = function (typeT, alias) { return new WhereBuilder(typeT, alias); }; WhereBuilder.prototype.getColumnParams = function (expression) { return utils_1.Utils.getColumnWhere(expression); }; return WhereBuilder; }(where_base_builder_1.WhereBaseBuilder)); exports.WhereBuilder = WhereBuilder;