zormz 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +14 -6
- package/dist/index.mjs +14 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -122,7 +122,7 @@ declare class DeleteR {
|
|
|
122
122
|
* DB.Delete(tabla).WHERE(AND(eq(valor,valor), eq(valor2,valor2)))
|
|
123
123
|
*/
|
|
124
124
|
where(condicion: string): this;
|
|
125
|
-
execute(): Promise<number | null>;
|
|
125
|
+
execute(seeQuery?: boolean): Promise<number | null>;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
type arrayData = (string | number | boolean)[];
|
|
@@ -154,7 +154,7 @@ declare class QueryBuilder {
|
|
|
154
154
|
* @returns
|
|
155
155
|
*/
|
|
156
156
|
Values(values: arrayData | arrayDatas): this;
|
|
157
|
-
execute(): Promise<number | any[] | undefined>;
|
|
157
|
+
execute(see?: boolean): Promise<number | any[] | undefined>;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
type valor = "ASC" | "DESC";
|
|
@@ -214,7 +214,7 @@ declare class Select {
|
|
|
214
214
|
/**
|
|
215
215
|
* @returns {Promise<Array<Object>>}
|
|
216
216
|
*/
|
|
217
|
-
execute(): Promise<any[] | undefined>;
|
|
217
|
+
execute(see?: boolean): Promise<any[] | undefined>;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
type Valores = Record<string, string | number | undefined>;
|
|
@@ -245,7 +245,7 @@ declare class Update {
|
|
|
245
245
|
* where(ORQ())
|
|
246
246
|
*/
|
|
247
247
|
where(condicion: string): this;
|
|
248
|
-
execute(): Promise<any>;
|
|
248
|
+
execute(seeQuery?: boolean): Promise<any>;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
declare class DB {
|
package/dist/index.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ declare class DeleteR {
|
|
|
122
122
|
* DB.Delete(tabla).WHERE(AND(eq(valor,valor), eq(valor2,valor2)))
|
|
123
123
|
*/
|
|
124
124
|
where(condicion: string): this;
|
|
125
|
-
execute(): Promise<number | null>;
|
|
125
|
+
execute(seeQuery?: boolean): Promise<number | null>;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
type arrayData = (string | number | boolean)[];
|
|
@@ -154,7 +154,7 @@ declare class QueryBuilder {
|
|
|
154
154
|
* @returns
|
|
155
155
|
*/
|
|
156
156
|
Values(values: arrayData | arrayDatas): this;
|
|
157
|
-
execute(): Promise<number | any[] | undefined>;
|
|
157
|
+
execute(see?: boolean): Promise<number | any[] | undefined>;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
type valor = "ASC" | "DESC";
|
|
@@ -214,7 +214,7 @@ declare class Select {
|
|
|
214
214
|
/**
|
|
215
215
|
* @returns {Promise<Array<Object>>}
|
|
216
216
|
*/
|
|
217
|
-
execute(): Promise<any[] | undefined>;
|
|
217
|
+
execute(see?: boolean): Promise<any[] | undefined>;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
type Valores = Record<string, string | number | undefined>;
|
|
@@ -245,7 +245,7 @@ declare class Update {
|
|
|
245
245
|
* where(ORQ())
|
|
246
246
|
*/
|
|
247
247
|
where(condicion: string): this;
|
|
248
|
-
execute(): Promise<any>;
|
|
248
|
+
execute(seeQuery?: boolean): Promise<any>;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
declare class DB {
|
package/dist/index.js
CHANGED
|
@@ -145,7 +145,6 @@ var BDconnection = class {
|
|
|
145
145
|
mensaje,
|
|
146
146
|
alertar = true
|
|
147
147
|
}) {
|
|
148
|
-
console.log(query);
|
|
149
148
|
try {
|
|
150
149
|
if (this.tipo === "mysql") {
|
|
151
150
|
const pool = await this.conexionMysql();
|
|
@@ -176,7 +175,6 @@ var BDconnection = class {
|
|
|
176
175
|
return respuesta;
|
|
177
176
|
}
|
|
178
177
|
} catch (error) {
|
|
179
|
-
console.log(error);
|
|
180
178
|
if (!alertar) return;
|
|
181
179
|
if (typeof error === "object" && error !== null && "code" in error) {
|
|
182
180
|
if (error.code === "ETIMEDOUT") {
|
|
@@ -376,8 +374,9 @@ var DeleteR = class {
|
|
|
376
374
|
__privateSet(this, _condicion, ` where ${condicion}`);
|
|
377
375
|
return this;
|
|
378
376
|
}
|
|
379
|
-
async execute() {
|
|
377
|
+
async execute(seeQuery = false) {
|
|
380
378
|
const query = `DELETE FROM ${__privateGet(this, _tabla)} ${__privateGet(this, _condicion)}`;
|
|
379
|
+
if (seeQuery) console.log(query);
|
|
381
380
|
if (this.conexion.tipo === "mysql") {
|
|
382
381
|
const respuesta = await this.conexion.executeConsulta({
|
|
383
382
|
query,
|
|
@@ -439,7 +438,7 @@ var QueryBuilder = class {
|
|
|
439
438
|
this.valores = values;
|
|
440
439
|
return this;
|
|
441
440
|
}
|
|
442
|
-
async execute() {
|
|
441
|
+
async execute(see = false) {
|
|
443
442
|
this.valorRetorno = 1;
|
|
444
443
|
let query1 = `INSERT INTO ${this.tabla} `;
|
|
445
444
|
let param = "";
|
|
@@ -493,6 +492,9 @@ var QueryBuilder = class {
|
|
|
493
492
|
} else {
|
|
494
493
|
query += paramespaces;
|
|
495
494
|
}
|
|
495
|
+
if (see) {
|
|
496
|
+
console.log(query);
|
|
497
|
+
}
|
|
496
498
|
if (this.conexion.tipo === "mysql") {
|
|
497
499
|
const respuesta = await this.conexion.executeConsulta({
|
|
498
500
|
query,
|
|
@@ -620,7 +622,7 @@ var Select = class {
|
|
|
620
622
|
/**
|
|
621
623
|
* @returns {Promise<Array<Object>>}
|
|
622
624
|
*/
|
|
623
|
-
async execute() {
|
|
625
|
+
async execute(see = false) {
|
|
624
626
|
let selectFields = "*";
|
|
625
627
|
if (this.valores) {
|
|
626
628
|
if (typeof this.parametros !== "undefined" && typeof this.parametros !== "string") {
|
|
@@ -628,6 +630,9 @@ var Select = class {
|
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
632
|
const query = `SELECT ${selectFields} from ${this.tabla} ${this.innerJoin} ${this.leftjoins} ${this.rigthjoins} ${this.condicion} ${this.orderBy} ${this.limit};`;
|
|
633
|
+
if (see) {
|
|
634
|
+
console.log(query);
|
|
635
|
+
}
|
|
631
636
|
if (this.conexion.tipo === "mysql") {
|
|
632
637
|
const respuesta = await this.conexion.executeConsulta({
|
|
633
638
|
query,
|
|
@@ -778,8 +783,11 @@ var Update = class {
|
|
|
778
783
|
}
|
|
779
784
|
return this;
|
|
780
785
|
}
|
|
781
|
-
async execute() {
|
|
786
|
+
async execute(seeQuery = false) {
|
|
782
787
|
const query = `UPDATE ${this.nombreTabla} SET ${this.valores} ${this.condicion};`;
|
|
788
|
+
if (seeQuery) {
|
|
789
|
+
console.log(seeQuery);
|
|
790
|
+
}
|
|
783
791
|
const respuesta = await this.conexion.executeConsulta({
|
|
784
792
|
query,
|
|
785
793
|
mensaje: "Error Update"
|
package/dist/index.mjs
CHANGED
|
@@ -82,7 +82,6 @@ var BDconnection = class {
|
|
|
82
82
|
mensaje,
|
|
83
83
|
alertar = true
|
|
84
84
|
}) {
|
|
85
|
-
console.log(query);
|
|
86
85
|
try {
|
|
87
86
|
if (this.tipo === "mysql") {
|
|
88
87
|
const pool = await this.conexionMysql();
|
|
@@ -113,7 +112,6 @@ var BDconnection = class {
|
|
|
113
112
|
return respuesta;
|
|
114
113
|
}
|
|
115
114
|
} catch (error) {
|
|
116
|
-
console.log(error);
|
|
117
115
|
if (!alertar) return;
|
|
118
116
|
if (typeof error === "object" && error !== null && "code" in error) {
|
|
119
117
|
if (error.code === "ETIMEDOUT") {
|
|
@@ -313,8 +311,9 @@ var DeleteR = class {
|
|
|
313
311
|
__privateSet(this, _condicion, ` where ${condicion}`);
|
|
314
312
|
return this;
|
|
315
313
|
}
|
|
316
|
-
async execute() {
|
|
314
|
+
async execute(seeQuery = false) {
|
|
317
315
|
const query = `DELETE FROM ${__privateGet(this, _tabla)} ${__privateGet(this, _condicion)}`;
|
|
316
|
+
if (seeQuery) console.log(query);
|
|
318
317
|
if (this.conexion.tipo === "mysql") {
|
|
319
318
|
const respuesta = await this.conexion.executeConsulta({
|
|
320
319
|
query,
|
|
@@ -376,7 +375,7 @@ var QueryBuilder = class {
|
|
|
376
375
|
this.valores = values;
|
|
377
376
|
return this;
|
|
378
377
|
}
|
|
379
|
-
async execute() {
|
|
378
|
+
async execute(see = false) {
|
|
380
379
|
this.valorRetorno = 1;
|
|
381
380
|
let query1 = `INSERT INTO ${this.tabla} `;
|
|
382
381
|
let param = "";
|
|
@@ -430,6 +429,9 @@ var QueryBuilder = class {
|
|
|
430
429
|
} else {
|
|
431
430
|
query += paramespaces;
|
|
432
431
|
}
|
|
432
|
+
if (see) {
|
|
433
|
+
console.log(query);
|
|
434
|
+
}
|
|
433
435
|
if (this.conexion.tipo === "mysql") {
|
|
434
436
|
const respuesta = await this.conexion.executeConsulta({
|
|
435
437
|
query,
|
|
@@ -557,7 +559,7 @@ var Select = class {
|
|
|
557
559
|
/**
|
|
558
560
|
* @returns {Promise<Array<Object>>}
|
|
559
561
|
*/
|
|
560
|
-
async execute() {
|
|
562
|
+
async execute(see = false) {
|
|
561
563
|
let selectFields = "*";
|
|
562
564
|
if (this.valores) {
|
|
563
565
|
if (typeof this.parametros !== "undefined" && typeof this.parametros !== "string") {
|
|
@@ -565,6 +567,9 @@ var Select = class {
|
|
|
565
567
|
}
|
|
566
568
|
}
|
|
567
569
|
const query = `SELECT ${selectFields} from ${this.tabla} ${this.innerJoin} ${this.leftjoins} ${this.rigthjoins} ${this.condicion} ${this.orderBy} ${this.limit};`;
|
|
570
|
+
if (see) {
|
|
571
|
+
console.log(query);
|
|
572
|
+
}
|
|
568
573
|
if (this.conexion.tipo === "mysql") {
|
|
569
574
|
const respuesta = await this.conexion.executeConsulta({
|
|
570
575
|
query,
|
|
@@ -715,8 +720,11 @@ var Update = class {
|
|
|
715
720
|
}
|
|
716
721
|
return this;
|
|
717
722
|
}
|
|
718
|
-
async execute() {
|
|
723
|
+
async execute(seeQuery = false) {
|
|
719
724
|
const query = `UPDATE ${this.nombreTabla} SET ${this.valores} ${this.condicion};`;
|
|
725
|
+
if (seeQuery) {
|
|
726
|
+
console.log(seeQuery);
|
|
727
|
+
}
|
|
720
728
|
const respuesta = await this.conexion.executeConsulta({
|
|
721
729
|
query,
|
|
722
730
|
mensaje: "Error Update"
|