orchid-orm 1.17.35 → 1.17.37

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.mjs CHANGED
@@ -43,6 +43,10 @@ function createBaseTable({
43
43
  `Failed to determine file path of a base table. Please set the \`filePath\` option of \`createBaseTable\` manually.`
44
44
  );
45
45
  }
46
+ static instance() {
47
+ var _a2;
48
+ return (_a2 = this._instance) != null ? _a2 : this._instance = new this();
49
+ }
46
50
  clone() {
47
51
  return this;
48
52
  }
@@ -72,7 +76,7 @@ function createBaseTable({
72
76
  }
73
77
  }
74
78
  }
75
- return this.constructor.prototype.columns = shape;
79
+ return shape;
76
80
  }
77
81
  setComputed(computed) {
78
82
  return computed;
@@ -1695,7 +1699,7 @@ const orchidORM = (_a, tables) => {
1695
1699
  if (key[0] === "$") {
1696
1700
  throw new Error(`Table class name must not start with $`);
1697
1701
  }
1698
- const table = new tables[key]();
1702
+ const table = tables[key].instance();
1699
1703
  tableInstances[key] = table;
1700
1704
  const options2 = __spreadProps(__spreadValues$1({}, commonOptions), {
1701
1705
  schema: table.schema,