zormz 1.4.7 → 1.5.0

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/README.md CHANGED
@@ -273,6 +273,15 @@ Agrupa múltiples condiciones con `AND`.
273
273
  AND(eq(), eq(), neq())
274
274
  ```
275
275
 
276
+
277
+ ### ANDD(...condiciones)
278
+ Agrupa múltiples condiciones con `AND`.
279
+
280
+ ```ts
281
+ ANDD([eq(), eq(), neq()])
282
+ ```
283
+
284
+
276
285
  ### OR(...condiciones)
277
286
  Agrupa múltiples condiciones con `OR`.
278
287
 
@@ -280,6 +289,14 @@ Agrupa múltiples condiciones con `OR`.
280
289
  OR(neq(), eq(), eq())
281
290
  ```
282
291
 
292
+ ### ORD([])
293
+ Agrupa múltiples condiciones con `OR`.
294
+
295
+ ```ts
296
+ ORD([neq(), eq(), eq()])
297
+ ```
298
+
299
+
283
300
  ### ORQ(campo,...valores)
284
301
  Genera multiples comparaciones `OR` para un mismo campo.
285
302
 
@@ -287,6 +304,14 @@ Genera multiples comparaciones `OR` para un mismo campo.
287
304
  ORQ("id",1,2,3);
288
305
  // => id = 1 or id = 2 or id = 3
289
306
  ```
307
+ ### ORQD(campo,valores[])
308
+ Genera multiples comparaciones `OR` para un mismo campo.
309
+
310
+ ```ts
311
+ ORQD("id",[1,2,3]);
312
+ // => id = 1 or id = 2 or id = 3
313
+ ```
314
+
290
315
  ---
291
316
  ### ILIKE(campo,valor)
292
317
  Comparacion insensible a mayusculas/minusculas
package/dist/index.d.mts CHANGED
@@ -278,6 +278,7 @@ type Valor = string | number | boolean;
278
278
  * AND(eq(),eq(),eq(),eq(),OR())
279
279
  */
280
280
  declare const AND: (...valor1: Valor[]) => string;
281
+ declare function ANDD(valores: string[]): string;
281
282
  /**
282
283
  *
283
284
  * @param {(string | number | boolean )} valor1 - eq(val,val1)
@@ -288,6 +289,14 @@ declare const AND: (...valor1: Valor[]) => string;
288
289
  * OR(eq(),eq(),eq(),eq(),AND())
289
290
  */
290
291
  declare const OR: (...valor1: Valor[]) => string;
292
+ /**
293
+ *
294
+ * @param {string} valores
295
+ * @returns
296
+ * @example
297
+ * ORD([eq(),eq()])
298
+ */
299
+ declare const ORD: (valores: string[]) => string;
291
300
  /**
292
301
  *
293
302
  * @param {Valor} condicion1
@@ -298,6 +307,17 @@ declare const OR: (...valor1: Valor[]) => string;
298
307
  * @returns
299
308
  */
300
309
  declare const ORQ: (condicion1: Valor, ...condicionals: Valor[]) => string;
310
+ /**
311
+ *
312
+ * @param {string} condicion
313
+ * @param {Valor[]} valores
314
+ * @returns
315
+ * @example
316
+ *
317
+ * ORQD("correos",["example@gmail.com","example2@gmail.com"])
318
+ *
319
+ */
320
+ declare const ORQD: (condicion: string, valores: Valor[]) => string;
301
321
  /**
302
322
  *
303
323
  * @param {string} valor1
@@ -480,4 +500,4 @@ declare class Money {
480
500
  }
481
501
  declare function money(presicion?: number, decimales?: number): Money;
482
502
 
483
- export { AND, BDconnection, CURRENT_TIMESTAMP, type Consultas, DB, DeleteR, ILIKE, MAYOR, MENOR, NOTNULL, NOW, NULL, OR, ORQ, QueryBuilder, Select, type TableProxy, type Tipos, UP, Update, type Valores, type arrayData, type arrayDatas, bool, type connecionLocal, type connecionRed, type connectionDB, defineTable, dropTable, eq, generateTable, getConexion, getRed, getTipoConexion, int, money, neq, timestamp, type valor, varchar };
503
+ export { AND, ANDD, BDconnection, CURRENT_TIMESTAMP, type Consultas, DB, DeleteR, ILIKE, MAYOR, MENOR, NOTNULL, NOW, NULL, OR, ORD, ORQ, ORQD, QueryBuilder, Select, type TableProxy, type Tipos, UP, Update, type Valores, type arrayData, type arrayDatas, bool, type connecionLocal, type connecionRed, type connectionDB, defineTable, dropTable, eq, generateTable, getConexion, getRed, getTipoConexion, int, money, neq, timestamp, type valor, varchar };
package/dist/index.d.ts CHANGED
@@ -278,6 +278,7 @@ type Valor = string | number | boolean;
278
278
  * AND(eq(),eq(),eq(),eq(),OR())
279
279
  */
280
280
  declare const AND: (...valor1: Valor[]) => string;
281
+ declare function ANDD(valores: string[]): string;
281
282
  /**
282
283
  *
283
284
  * @param {(string | number | boolean )} valor1 - eq(val,val1)
@@ -288,6 +289,14 @@ declare const AND: (...valor1: Valor[]) => string;
288
289
  * OR(eq(),eq(),eq(),eq(),AND())
289
290
  */
290
291
  declare const OR: (...valor1: Valor[]) => string;
292
+ /**
293
+ *
294
+ * @param {string} valores
295
+ * @returns
296
+ * @example
297
+ * ORD([eq(),eq()])
298
+ */
299
+ declare const ORD: (valores: string[]) => string;
291
300
  /**
292
301
  *
293
302
  * @param {Valor} condicion1
@@ -298,6 +307,17 @@ declare const OR: (...valor1: Valor[]) => string;
298
307
  * @returns
299
308
  */
300
309
  declare const ORQ: (condicion1: Valor, ...condicionals: Valor[]) => string;
310
+ /**
311
+ *
312
+ * @param {string} condicion
313
+ * @param {Valor[]} valores
314
+ * @returns
315
+ * @example
316
+ *
317
+ * ORQD("correos",["example@gmail.com","example2@gmail.com"])
318
+ *
319
+ */
320
+ declare const ORQD: (condicion: string, valores: Valor[]) => string;
301
321
  /**
302
322
  *
303
323
  * @param {string} valor1
@@ -480,4 +500,4 @@ declare class Money {
480
500
  }
481
501
  declare function money(presicion?: number, decimales?: number): Money;
482
502
 
483
- export { AND, BDconnection, CURRENT_TIMESTAMP, type Consultas, DB, DeleteR, ILIKE, MAYOR, MENOR, NOTNULL, NOW, NULL, OR, ORQ, QueryBuilder, Select, type TableProxy, type Tipos, UP, Update, type Valores, type arrayData, type arrayDatas, bool, type connecionLocal, type connecionRed, type connectionDB, defineTable, dropTable, eq, generateTable, getConexion, getRed, getTipoConexion, int, money, neq, timestamp, type valor, varchar };
503
+ export { AND, ANDD, BDconnection, CURRENT_TIMESTAMP, type Consultas, DB, DeleteR, ILIKE, MAYOR, MENOR, NOTNULL, NOW, NULL, OR, ORD, ORQ, ORQD, QueryBuilder, Select, type TableProxy, type Tipos, UP, Update, type Valores, type arrayData, type arrayDatas, bool, type connecionLocal, type connecionRed, type connectionDB, defineTable, dropTable, eq, generateTable, getConexion, getRed, getTipoConexion, int, money, neq, timestamp, type valor, varchar };
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
38
38
  var index_exports = {};
39
39
  __export(index_exports, {
40
40
  AND: () => AND,
41
+ ANDD: () => ANDD,
41
42
  BDconnection: () => BDconnection,
42
43
  CURRENT_TIMESTAMP: () => CURRENT_TIMESTAMP,
43
44
  DB: () => DB,
@@ -49,7 +50,9 @@ __export(index_exports, {
49
50
  NOW: () => NOW,
50
51
  NULL: () => NULL,
51
52
  OR: () => OR,
53
+ ORD: () => ORD,
52
54
  ORQ: () => ORQ,
55
+ ORQD: () => ORQD,
53
56
  QueryBuilder: () => QueryBuilder,
54
57
  Select: () => Select,
55
58
  UP: () => UP,
@@ -354,6 +357,11 @@ async function dropTable(nombreTabla) {
354
357
  mensaje: "Error al eliminar la tabla",
355
358
  alertar: false
356
359
  });
360
+ console.log(response);
361
+ if (response.command === "DROP") {
362
+ console.log(`\u{1F44D}\u{1F44D} Se elimino con exito la tabla ${nombreTabla} \u{1F44D}`);
363
+ return;
364
+ }
357
365
  console.log(` No existe la tabla ${nombreTabla} \u{1F622}`);
358
366
  }
359
367
  }
@@ -681,11 +689,19 @@ var Select = class {
681
689
  // conection/middleware/condicionals.ts
682
690
  var AND = (...valor1) => {
683
691
  const separacion = valor1.filter((dato) => dato !== void 0 && dato !== null).join(" and ");
684
- return `(${separacion})`;
692
+ return ` (${separacion}) `;
685
693
  };
694
+ function ANDD(valores) {
695
+ const separacion = valores.filter((dato) => dato !== void 0 && dato !== null).join(" and ");
696
+ return ` (${separacion}) `;
697
+ }
686
698
  var OR = (...valor1) => {
687
699
  const separadosComas = valor1.filter((dato) => dato !== void 0 && dato !== null).join(" or ");
688
- return `(${separadosComas})`;
700
+ return ` (${separadosComas}) `;
701
+ };
702
+ var ORD = (valores) => {
703
+ const separador = valores.filter((dato) => dato !== void 0 && dato !== null).join(" or ");
704
+ return ` (${separador}) `;
689
705
  };
690
706
  var ORQ = (condicion1, ...condicionals) => {
691
707
  const data2 = condicionals.map((dato) => {
@@ -693,7 +709,15 @@ var ORQ = (condicion1, ...condicionals) => {
693
709
  return ` ${condicion1} = '${dato}' `;
694
710
  });
695
711
  const separador = data2.join(" or ");
696
- return separador;
712
+ return ` (${separador}) `;
713
+ };
714
+ var ORQD = (condicion, valores) => {
715
+ const data = valores.map((dato) => {
716
+ if (typeof dato == "number" || typeof dato === "boolean") return ` ${condicion} = ${dato}`;
717
+ return ` ${condicion} = '${dato}' `;
718
+ });
719
+ const separador = data.join(" or ");
720
+ return ` ( ${separador} ) `;
697
721
  };
698
722
  var ILIKE = (valor1, valor2) => {
699
723
  return `${valor1} ILIKE '${valor2}'`;
@@ -1188,6 +1212,7 @@ function money(presicion = 10, decimales = 2) {
1188
1212
  // Annotate the CommonJS export names for ESM import in node:
1189
1213
  0 && (module.exports = {
1190
1214
  AND,
1215
+ ANDD,
1191
1216
  BDconnection,
1192
1217
  CURRENT_TIMESTAMP,
1193
1218
  DB,
@@ -1199,7 +1224,9 @@ function money(presicion = 10, decimales = 2) {
1199
1224
  NOW,
1200
1225
  NULL,
1201
1226
  OR,
1227
+ ORD,
1202
1228
  ORQ,
1229
+ ORQD,
1203
1230
  QueryBuilder,
1204
1231
  Select,
1205
1232
  UP,
package/dist/index.mjs CHANGED
@@ -290,6 +290,11 @@ async function dropTable(nombreTabla) {
290
290
  mensaje: "Error al eliminar la tabla",
291
291
  alertar: false
292
292
  });
293
+ console.log(response);
294
+ if (response.command === "DROP") {
295
+ console.log(`\u{1F44D}\u{1F44D} Se elimino con exito la tabla ${nombreTabla} \u{1F44D}`);
296
+ return;
297
+ }
293
298
  console.log(` No existe la tabla ${nombreTabla} \u{1F622}`);
294
299
  }
295
300
  }
@@ -617,11 +622,19 @@ var Select = class {
617
622
  // conection/middleware/condicionals.ts
618
623
  var AND = (...valor1) => {
619
624
  const separacion = valor1.filter((dato) => dato !== void 0 && dato !== null).join(" and ");
620
- return `(${separacion})`;
625
+ return ` (${separacion}) `;
621
626
  };
627
+ function ANDD(valores) {
628
+ const separacion = valores.filter((dato) => dato !== void 0 && dato !== null).join(" and ");
629
+ return ` (${separacion}) `;
630
+ }
622
631
  var OR = (...valor1) => {
623
632
  const separadosComas = valor1.filter((dato) => dato !== void 0 && dato !== null).join(" or ");
624
- return `(${separadosComas})`;
633
+ return ` (${separadosComas}) `;
634
+ };
635
+ var ORD = (valores) => {
636
+ const separador = valores.filter((dato) => dato !== void 0 && dato !== null).join(" or ");
637
+ return ` (${separador}) `;
625
638
  };
626
639
  var ORQ = (condicion1, ...condicionals) => {
627
640
  const data2 = condicionals.map((dato) => {
@@ -629,7 +642,15 @@ var ORQ = (condicion1, ...condicionals) => {
629
642
  return ` ${condicion1} = '${dato}' `;
630
643
  });
631
644
  const separador = data2.join(" or ");
632
- return separador;
645
+ return ` (${separador}) `;
646
+ };
647
+ var ORQD = (condicion, valores) => {
648
+ const data = valores.map((dato) => {
649
+ if (typeof dato == "number" || typeof dato === "boolean") return ` ${condicion} = ${dato}`;
650
+ return ` ${condicion} = '${dato}' `;
651
+ });
652
+ const separador = data.join(" or ");
653
+ return ` ( ${separador} ) `;
633
654
  };
634
655
  var ILIKE = (valor1, valor2) => {
635
656
  return `${valor1} ILIKE '${valor2}'`;
@@ -1123,6 +1144,7 @@ function money(presicion = 10, decimales = 2) {
1123
1144
  }
1124
1145
  export {
1125
1146
  AND,
1147
+ ANDD,
1126
1148
  BDconnection,
1127
1149
  CURRENT_TIMESTAMP,
1128
1150
  DB,
@@ -1134,7 +1156,9 @@ export {
1134
1156
  NOW,
1135
1157
  NULL,
1136
1158
  OR,
1159
+ ORD,
1137
1160
  ORQ,
1161
+ ORQD,
1138
1162
  QueryBuilder,
1139
1163
  Select,
1140
1164
  UP,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zormz",
3
- "version": "1.4.7",
3
+ "version": "1.5.0",
4
4
  "description": "Un ORM que busca ser ligero y facil de usar",
5
5
  "author": "yukio-kayaba",
6
6
  "license": "ISC",