zormz 1.2.7 → 1.2.8

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 CHANGED
@@ -1,13 +1,3 @@
1
- interface ResultSetHeaderMysql {
2
- fieldCount: number;
3
- affectedRows: number;
4
- insertId: number;
5
- info: string;
6
- serverStatus: number;
7
- warningStatus: number;
8
- changedRows: number;
9
- }
10
-
11
1
  type ColumnTypes =
12
2
  | "varchar"
13
3
  | "int"
@@ -126,8 +116,8 @@ declare class DeleteR {
126
116
  execute(): Promise<number | null>;
127
117
  }
128
118
 
129
- type arrayData = (string | number)[];
130
- type arrayDatas = (string | number)[][];
119
+ type arrayData = (string | number | boolean)[];
120
+ type arrayDatas = (string | number | boolean)[][];
131
121
  declare class QueryBuilder {
132
122
  private tabla;
133
123
  private parametros;
@@ -215,7 +205,7 @@ declare class Select {
215
205
  /**
216
206
  * @returns {Promise<Array<Object>>}
217
207
  */
218
- execute(): Promise<any[] | ResultSetHeaderMysql | undefined>;
208
+ execute(): Promise<any[] | undefined>;
219
209
  }
220
210
 
221
211
  type Valores = Record<string, string | number | undefined>;
package/dist/index.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- interface ResultSetHeaderMysql {
2
- fieldCount: number;
3
- affectedRows: number;
4
- insertId: number;
5
- info: string;
6
- serverStatus: number;
7
- warningStatus: number;
8
- changedRows: number;
9
- }
10
-
11
1
  type ColumnTypes =
12
2
  | "varchar"
13
3
  | "int"
@@ -126,8 +116,8 @@ declare class DeleteR {
126
116
  execute(): Promise<number | null>;
127
117
  }
128
118
 
129
- type arrayData = (string | number)[];
130
- type arrayDatas = (string | number)[][];
119
+ type arrayData = (string | number | boolean)[];
120
+ type arrayDatas = (string | number | boolean)[][];
131
121
  declare class QueryBuilder {
132
122
  private tabla;
133
123
  private parametros;
@@ -215,7 +205,7 @@ declare class Select {
215
205
  /**
216
206
  * @returns {Promise<Array<Object>>}
217
207
  */
218
- execute(): Promise<any[] | ResultSetHeaderMysql | undefined>;
208
+ execute(): Promise<any[] | undefined>;
219
209
  }
220
210
 
221
211
  type Valores = Record<string, string | number | undefined>;
package/dist/index.js CHANGED
@@ -129,7 +129,7 @@ var BDconnection = class {
129
129
  try {
130
130
  if (this.tipo === "mysql") {
131
131
  const pool = await this.connecionMyql();
132
- const [rows] = await pool.query(query, [valores]);
132
+ const [rows] = await pool.query(query, valores);
133
133
  return rows;
134
134
  } else if (this.tipo === "pg") {
135
135
  let query2 = query;
@@ -350,7 +350,9 @@ var QueryBuilder = class {
350
350
  let paramespaces = "";
351
351
  if (this.conexion.tipo === "mysql") {
352
352
  if (typeof this.parametros !== "string") {
353
- if (Array.isArray(this.valores[0])) arrayArrays = true;
353
+ if (Array.isArray(this.valores[0])) {
354
+ arrayArrays = true;
355
+ }
354
356
  this.parametros.forEach((valor, index) => {
355
357
  param += valor;
356
358
  paramespaces += `?`;
@@ -397,10 +399,9 @@ var QueryBuilder = class {
397
399
  if (this.conexion.tipo === "mysql") {
398
400
  const respuesta = await this.conexion.executeConsulta({
399
401
  query,
400
- valores: this.valores,
402
+ valores: arrayArrays ? [this.valores] : this.valores,
401
403
  mensaje: `Ocurrio un error al ingresar datos a ${this.tabla} `
402
404
  });
403
- console.log(respuesta);
404
405
  return respuesta.insertId;
405
406
  } else if (this.conexion.tipo === "pg") {
406
407
  query += " RETURNING id ";
package/dist/index.mjs CHANGED
@@ -68,7 +68,7 @@ var BDconnection = class {
68
68
  try {
69
69
  if (this.tipo === "mysql") {
70
70
  const pool = await this.connecionMyql();
71
- const [rows] = await pool.query(query, [valores]);
71
+ const [rows] = await pool.query(query, valores);
72
72
  return rows;
73
73
  } else if (this.tipo === "pg") {
74
74
  let query2 = query;
@@ -289,7 +289,9 @@ var QueryBuilder = class {
289
289
  let paramespaces = "";
290
290
  if (this.conexion.tipo === "mysql") {
291
291
  if (typeof this.parametros !== "string") {
292
- if (Array.isArray(this.valores[0])) arrayArrays = true;
292
+ if (Array.isArray(this.valores[0])) {
293
+ arrayArrays = true;
294
+ }
293
295
  this.parametros.forEach((valor, index) => {
294
296
  param += valor;
295
297
  paramespaces += `?`;
@@ -336,10 +338,9 @@ var QueryBuilder = class {
336
338
  if (this.conexion.tipo === "mysql") {
337
339
  const respuesta = await this.conexion.executeConsulta({
338
340
  query,
339
- valores: this.valores,
341
+ valores: arrayArrays ? [this.valores] : this.valores,
340
342
  mensaje: `Ocurrio un error al ingresar datos a ${this.tabla} `
341
343
  });
342
- console.log(respuesta);
343
344
  return respuesta.insertId;
344
345
  } else if (this.conexion.tipo === "pg") {
345
346
  query += " RETURNING id ";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zormz",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",