@inflector/optima 1.0.7 → 1.0.9

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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DuckDBConnection, DuckDBInstance } from '@duckdb/node-api';
2
2
  import * as z from 'zod';
3
- export * from 'zod';
3
+ export { any, array, bigint, date, number, object, string } from 'zod';
4
4
 
5
5
  type SetFlag$1<C extends ColumnConfig, K extends keyof ColumnConfig> = Omit<C, K> & {
6
6
  [P in K]: true;
@@ -59,7 +59,6 @@ declare const Uuid: () => ColumnBuilder<string, SetFlag$1<Restrict<"defaultNow">
59
59
  declare const DateType: () => ColumnBuilder<Date, SetFlag$1<Restrict<"default">, "SQlType">, never>;
60
60
  declare const Timestamp: () => ColumnBuilder<Date, SetFlag$1<Restrict<"default">, "SQlType">, never>;
61
61
  declare const Enum: <T extends string | number>(vals: readonly T[]) => ColumnBuilder<T, SetFlag$1<SetFlag$1<Restrict<"defaultNow">, "validate">, "SQlType">, never>;
62
-
63
62
  declare const Json: <T extends z.ZodRawShape>(obj: T) => ColumnBuilder<z.core.$InferObjectOutput<T, {}>, SetFlag$1<Restrict<"primaryKey" | "unique" | "defaultNow">, "SQlType">, never>;
64
63
  declare const Array$1: <T extends z.ZodTypeAny>(schema: T) => ColumnBuilder<z.core.output<T>[], SetFlag$1<Restrict<"primaryKey" | "unique" | "defaultNow">, "SQlType">, never>;
65
64
  declare const Email: () => ColumnBuilder<string, SetFlag$1<SetFlag$1<Restrict<"defaultNow">, "SQlType">, "validate">, never>;
package/dist/index.js CHANGED
@@ -1,99 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
-
19
- // src/index.ts
20
- var index_exports = {};
21
- __export(index_exports, {
22
- Array: () => Array2,
23
- BigInt: () => BigInt,
24
- Boolean: () => Boolean,
25
- Bytes: () => Bytes,
26
- Color: () => Color,
27
- DateType: () => DateType,
28
- Email: () => Email,
29
- Enum: () => Enum,
30
- Float: () => Float,
31
- GeoArea: () => GeoArea,
32
- GeoPoint: () => GeoPoint,
33
- Int: () => Int,
34
- Json: () => Json,
35
- OptimaDB: () => OptimaDB,
36
- Password: () => Password,
37
- SQLBuilder: () => SQLBuilder,
38
- Slug: () => Slug,
39
- Table: () => Table,
40
- Text: () => Text,
41
- Timestamp: () => Timestamp,
42
- Uuid: () => Uuid,
43
- between: () => between,
44
- cond: () => cond,
45
- contains: () => contains,
46
- endsWith: () => endsWith,
47
- eq: () => eq,
48
- gt: () => gt,
49
- gte: () => gte,
50
- inOp: () => inOp,
51
- is: () => is,
52
- isNot: () => isNot,
53
- like: () => like,
54
- lt: () => lt,
55
- lte: () => lte,
56
- ne: () => ne,
57
- notBetween: () => notBetween,
58
- notIn: () => notIn,
59
- notLike: () => notLike,
60
- notRegexp: () => notRegexp,
61
- refHelpers: () => refHelpers,
62
- regexp: () => regexp,
63
- startsWith: () => startsWith
64
- });
65
-
66
1
  // src/database.ts
67
2
  import { DuckDBInstance } from "@duckdb/node-api";
68
3
 
69
4
  // src/schema.ts
70
- var schema_exports = {};
71
- __export(schema_exports, {
72
- Array: () => Array2,
73
- BigInt: () => BigInt,
74
- Boolean: () => Boolean,
75
- Bytes: () => Bytes,
76
- Color: () => Color,
77
- DateType: () => DateType,
78
- Email: () => Email,
79
- Enum: () => Enum,
80
- Float: () => Float,
81
- GeoArea: () => GeoArea,
82
- GeoPoint: () => GeoPoint,
83
- Int: () => Int,
84
- Json: () => Json,
85
- Password: () => Password,
86
- SQLBuilder: () => SQLBuilder,
87
- Slug: () => Slug,
88
- Table: () => Table,
89
- Text: () => Text,
90
- Timestamp: () => Timestamp,
91
- Uuid: () => Uuid,
92
- refHelpers: () => refHelpers
93
- });
94
- __reExport(schema_exports, zod_star);
95
5
  import * as z from "zod";
96
- import * as zod_star from "zod";
97
6
  var refHelpers = {
98
7
  one: (ref) => ref,
99
8
  many: (ref) => ref
@@ -594,7 +503,6 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
594
503
  };
595
504
  this.BuildUpdate = (TableName, changes, options) => {
596
505
  const { where, returning } = options;
597
- console.log(changes);
598
506
  const setClauses = [];
599
507
  for (const [key, value] of Object.entries(changes)) {
600
508
  if (value !== void 0) {
@@ -689,7 +597,6 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
689
597
  }
690
598
  async InitTable() {
691
599
  const SQL = SQLBuilder.BuildTable(this.Name, this.Columns);
692
- console.log(SQL);
693
600
  await this.Connection.run(SQL);
694
601
  }
695
602
  static async create(name, Columns, Connection) {
@@ -936,7 +843,6 @@ var OptimaDB = class _OptimaDB {
936
843
  const cleanSchema = SchemaMigrator.transformSchema(schema);
937
844
  const migrationSQL = SchemaMigrator.generateSQL(existingTables, cleanSchema);
938
845
  if (migrationSQL.length > 0) {
939
- console.log(`[OptimaDB] Applying ${migrationSQL.length} migrations...`);
940
846
  await connection.run("BEGIN TRANSACTION;");
941
847
  try {
942
848
  for (const sql of migrationSQL) {
@@ -1120,7 +1026,7 @@ var SchemaMigrator = class {
1120
1026
  };
1121
1027
 
1122
1028
  // src/index.ts
1123
- __reExport(index_exports, schema_exports);
1029
+ import { number, string, object as object2, array, any, bigint, date } from "zod";
1124
1030
  export {
1125
1031
  Array2 as Array,
1126
1032
  BigInt,
@@ -1143,9 +1049,13 @@ export {
1143
1049
  Text,
1144
1050
  Timestamp,
1145
1051
  Uuid,
1052
+ any,
1053
+ array,
1146
1054
  between,
1055
+ bigint,
1147
1056
  cond,
1148
1057
  contains,
1058
+ date,
1149
1059
  endsWith,
1150
1060
  eq,
1151
1061
  gt,
@@ -1161,7 +1071,10 @@ export {
1161
1071
  notIn,
1162
1072
  notLike,
1163
1073
  notRegexp,
1074
+ number,
1075
+ object2 as object,
1164
1076
  refHelpers,
1165
1077
  regexp,
1166
- startsWith
1078
+ startsWith,
1079
+ string
1167
1080
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflector/optima",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "author": "Inflector",
6
6
  "main": "./dist/index.js",